Question on DataRow.Import method

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello
I've written some code that uses the import method of a DataRow object and when I submit it for updating the changes were not being populated to the Sql Server Database. I noticed in debug mode that the RowState property for each row imported is "unchanged". I have a hunch that this is the problem. Does anyone know how to set this property to "modified" when importing

Thanks
Phillip
 
Hello,
I've written some code that uses the import method of a DataRow object
and when I submit it for updating the changes were not being populated to
the Sql Server Database. I noticed in debug mode that the RowState
property for each row imported is "unchanged". I have a hunch that this
is the problem. Does anyone know how to set this property to "modified"
when importing.

Witnessed the same behaviour just yesterday (had to renounce to use Import()
:-( ).
This is even stranger than DataSet.HasChanges() returning false after a
DataSet.Merge()...

Massimo
 
Contacted MS. In my case, I was importing from one DataAdapter to another. So all I had to do was use this line of code before the DataAdapter fill method on the source DataAdapter

sourceAdpater.AcceptChangesDuringFill=false

Afterwards I call the fill method and the RowState property of the source DataSet are now set to "Added". Then I imported the data into the destination table and called my update function and it worked. I've asked MS for any info on performance issues regarding the DataRow.Import method but haven't gotten an answer yet.
 
Back
Top