M
Michael Combs
I am attempting to update a table using primary key data without first
filling a datatable. Here are the details...
I am filling a datatable from a SQL Server table and then storing
that information to be transferred and used remotely. The table data
does contain a primary key (standard autoincrement id) which is used
to apply any updates to changed data. At a later time when those data
changes come back to the local server I want to build a datatable with
the updated information (and primary key) and issue those changes to
the database. The problem of course is that building the datatable
from the inbound data causese the datarows to have a rowstate of added
rather than modified. I've attempted to call acceptchanges on those
rows and then subsequently setting the ID field so that the rowstate
becomes modified. However, upon calling update, I get a status of
SkipCurrentRow in the RowUpdating event of the dataadapter. I've tried
setting the status to Continue in that event. This causes a subsequent
exception to be thrown which is "Update requires the command clone to
be valid.". Any suggestions?
Thanks in advance,
Michael Combs
filling a datatable. Here are the details...
I am filling a datatable from a SQL Server table and then storing
that information to be transferred and used remotely. The table data
does contain a primary key (standard autoincrement id) which is used
to apply any updates to changed data. At a later time when those data
changes come back to the local server I want to build a datatable with
the updated information (and primary key) and issue those changes to
the database. The problem of course is that building the datatable
from the inbound data causese the datarows to have a rowstate of added
rather than modified. I've attempted to call acceptchanges on those
rows and then subsequently setting the ID field so that the rowstate
becomes modified. However, upon calling update, I get a status of
SkipCurrentRow in the RowUpdating event of the dataadapter. I've tried
setting the status to Continue in that event. This causes a subsequent
exception to be thrown which is "Update requires the command clone to
be valid.". Any suggestions?
Thanks in advance,
Michael Combs