Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating with data adpater

Status
Not open for further replies.

kyledunn

Programmer
Jan 2, 2001
145
US
I have successfully filled a dataset using the data adapter, added new records to the dataset with the NewRecord function and updated the source database with one call to the data adapter Update function. When I change the data in the fields of the dataset and call the data adapter Update function I thought the source database would get updated with the one call. It's not working for me. The only way I have been able to update the source database was to write a command and use ExecuteNonQuery. What is the C# or VB.NET syntax for updating the source database after the fields in the dataset have been changed using the data adapter?
 
It should be something like this:

da.update(ds, "dsname")

Note, I had problems when I didn't specify the datasetname.
 
Thanks for your response Colin. When I wrote the email above I was updating the dataset table directly, I had not defined the datarow I was working with and I think that is what caused the problem. I have since moved on to adding a dataview so I can sort the dataset. In the code for updating a row in the dataview I had defined a DataRowView and that fixed the problem and data adapter update worked!

Kyle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top