Quote:
Originally Posted by nch1978
I am new to programming and am sorry if this post is in the wrong area. I have a listbox bound to a table and a datagrid bound to another one with a connection through xml. I can change the data within the grid, with the following through a button on a different tab page within the form, but it does not save changes to the database, just shows them on the datagrid until the program is closed:
'Temporary Datasets to store the inserted or modified rows
Dim pdsInsertedRows, pdsModifiedRows As DataSet
'Set the menu items to indicate that a record is being edited
Call EditState(cblnNotEditing)
'End editing on current record
Me.BindingContext(DsClientServiceBinding1). _
EndCurrentEdit()
'copy the DataSet by getting the added or modified records from the
'origional bound Dataset
pdsInsertedRows = DsClientServiceBinding1.GetChanges(DataRowState.Ad ded)
pdsModifiedRows = DsClientServiceBinding1.GetChanges(DataRowState.Mo dified)
'Check to see if there is modified rows. If there is update the Dataset
If Not pdsModifiedRows Is Nothing Then
odbdaTickets1.Update(pdsModifiedRows)
End If
'Check to see if there are inserted rows and update
If Not pdsInsertedRows Is Nothing Then
odbdaTickets1.Update(pdsInsertedRows)
End If
'Synchronize the database with the Dataset by accepting changes
DsClientServiceBinding1.AcceptChanges()
Thank you in advance for your help,
Greetings and salutations!
I think this is what you want, looked through it myself. You'll need to do some reading:
http://www.codeproject.com/cs/databa...select=1644938
In a bit, and have fun with the project...