tate Posted November 11, 2003 Posted November 11, 2003 (edited) I'm quite familiar with how to update a single datagrid so the source database table if updated. dsInsertedRows = dsDataSet.GetChanges(DataRowState.Added) dsModifiedRows = dsDataSet.GetChanges(DataRowState.Modified) dsDeletedRows = dsDataSet.GetChanges(DataRowState.Deleted) If Not dsInsertedRows Is Nothing Then odbdaDataBase.Update(dsInsertedRows) End If If Not dsModifiedRows Is Nothing Then odbdaDataBase.Update(dsModifiedRows) End If If Not dsDeletedRows Is Nothing Then odbdaDataBase.Update(dsDeletedRows) End If dsDataSet.AcceptChanges() However, I'm working on a solution that utilizes a single dataset that contains 3 different database tables (3 data adapters) that are linked by 2 data relations. The data from each table is displayed in a seperate datagrid. My problem is if I use the same type of code as above to update the complete dataset an error is generated when trying to update a data adapter that doesn't have a change. If Not dsModifiedRows Is Nothing Then odbdaDataBaseTable1.Update(dsModifiedRows) odbdaDataBaseTable2.Update(dsModifiedRows) odbdaDataBaseTable3.Update(dsModifiedRows) End If I haven't bee able to figure out a way to capture the changes (GetChanges) for a particular data adapter. Any suggestions? Thanks in advance. [edit]added [vb ] tags [/vb ][/edit] Edited November 11, 2003 by Robby Quote
tate Posted November 12, 2003 Author Posted November 12, 2003 I have been able to make the update function properly. However, you have to select update after each change. If changes were made to multiple datagrid records and then update was selected only the first datagrid would update properly, all other changes were lost. Quote
sizer Posted November 12, 2003 Posted November 12, 2003 see the http://www.xtremedotnettalk.com/t79350.html... Quote Some people are wise and some are other-wise.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.