Updating database from Typed Dataset without loading entire database

  • Thread starter Thread starter Jeremy Summers
  • Start date Start date
J

Jeremy Summers

I am trying to add some new records to a table and I have the new records in
memory in a typed dataset. How can I update the database with these new
records without loading the entire table into a dataset (it is quite large)?

Jeremy Summers
 
Hi Jeremy,
The following should work:

If myDataSet.myDataTable.HasChanges(DataRowState.Added)
Then
dim dtAdded as DataTable =
myDataSet.myDataTable.GetChanges(DataRowState.Added)
 
Sorry Jeremy - pushed the wrong button and posted
prematurely. One more line of code to add....

myDataAdapter.Update(dtModified)

JT
 
Back
Top