i want to update the datagrid if there
Post the code you are using for that sub.
Solutions like these can be found using the VB.NET/ADO.NET Newsgroup Search
Tool at
http://www.kjmsolutions.com/newsgrouptool.htm
This may work. Please do not mass post like this again.
'in the example code below it is assumed that each data
'adapter (MyAD1, MyAD2, MyAd3) have commands for update
'delete and inserts for the respective tables they are
'managing.
MyAD1.Update(MyDS.Tables(0))
MyAD2.Update(MyDS.Tables(1))
MyAD3.Update(MyDS.Tables(2))
'This is a very simplistic code example. If there
'are parent/child relationships involed here then you
'have to break up the process lets say the tables
'are 1 parent to two that is parent to 3. If you have
'updates, inserts, and deletes happening in all of
'the datase's tables then yoyu have to submit things
'in order.
'submit all the inserts first starting from the
'top table on down
MyAD1.Update(MyDS.Tables(0).Select("", "", DataViewRowState.Added))
MyAD1.Update(MyDS.Tables(1).Select("", "", DataViewRowState.Added))
MyAD1.Update(MyDS.Tables(2).Select("", "", DataViewRowState.Added))
'now submit the updated rows
MyAD1.Update(MyDS.Tables(0).Select("", "",
DataViewRowState.ModifiedCurrent))
MyAD1.Update(MyDS.Tables(1).Select("", "",
DataViewRowState.ModifiedCurrent))
MyAD1.Update(MyDS.Tables(2).Select("", "",
DataViewRowState.ModifiedCurrent))
'finally submit the deletions from the bottom up
MyAD3.Update(MyDS.Tables(2).Select("", "", DataViewRowState.Deleted))
MyAD2.Update(MyDS.Tables(1).Select("", "", DataViewRowState.Deleted))
MyAD1.Update(MyDS.Tables(0).Select("", "", DataViewRowState.Deleted))
'the above will work in most situations. This code is untested.