Updating database from Typed Dataset without loading entire database

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
 
J

JT

Hi Jeremy,
The following should work:

If myDataSet.myDataTable.HasChanges(DataRowState.Added)
Then
dim dtAdded as DataTable =
myDataSet.myDataTable.GetChanges(DataRowState.Added)
 
J

JT

Sorry Jeremy - pushed the wrong button and posted
prematurely. One more line of code to add....

myDataAdapter.Update(dtModified)

JT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top