When you fill a typed dataset using a dataadapter, modify certain columns of
data and call the update method to push the changes back to the server, does
the dataadapter only update the columns that changed or does it update the
columns that changed with new data and the columns that didn't change with
the same data it had before?
The reason I need to know is this: I have a table used in merge replication
for SQL Server CE devices. The handheld users only modify certain columns
in the field. I also have a program that pulls data from Intuit Master
Builder which is a FoxPro based construction management program. I created
a table on the SQL Server that includes all of the columns from the FoxPro
dbf file and the other columns that we need to track (like these handheld
modified columns). I have a program that runs on the server using a .NET
framework filewatcher that watches the dbf files and if it detects a change
it refreshes the SQL server table. This way I have one SQL Server table
that has all of the data in one table without complicated joins. We can't
send the foxpro tables to the handheld so by merging the foxpro data into
SQL Server, the handheld users can have all of the foxpro data as readonly
and all of the other data as read/write. The problem I am running into is
that the handheld users will make changes during the day and when they sync
up, all of their changes are lost. I checked the server and the replication
monitor shows the data was conflicting and the copy on the server won. I
can't keep going to the server to overwrite the confict changes everytime a
user syncs, so I need to modify the code in my file monitor program. I am
assuming that the file monitor program which updates the tables anywhere
from several times a minute to once every two hours depending on what the
users are doing in Master Builder, is refreshing the rows so many times that
the replication manager thinks that the data in the row is newer no matter
what. I want to minimize the amount of data the file monitor pushes into
SQL server so I have created If Then statements to compare the foxpro data
to the sql server data before it updates the dataset that I am pushing back
to sql server. I need to know if the update method of the dataadapter
pushes every column back to the server or just the columns that from the
dataset that are marked as changed. I suspect that it pushes them all back
because the command text associated with the update command of the
dataadapter has all of the fields listed with parameters. Therefore, I
suspect that if I want to minimize the amount of data that I send back, I
would have to build my update command text dynamically in those IF THEN
statements and then replace the command text of the adapter before calling
the update method or call the executenonquery method of the command.
Any comments will be appreciated.
Kiere
|