December 2002
Beginner to intermediate
432 pages
10h 10m
English
To make this easier, we are going to create a method that we will call to update the database. We could probably emulate the old ADO Data Control’s behavior, but instead let’s create an UpdateChanges method:
Public Sub UpdateChanges()
Dim dsTemp As DataSet
Try
If mAdapter.InsertCommand.CommandText = "" And _
mAdapter.UpdateCommand.CommandText = "" And _
mAdapter.DeleteCommand.CommandText = "" Then
Exit Sub
End If
Me.ParentForm.BindingContext(Me).EndCurrentEdit()
If mDataSet.HasChanges Then
mAdapter.Update(mDataSet.Tables(mintBoundTable).GetChanges)
mDataSet.AcceptChanges()
mDataSet.Clear()
mAdapter.Fill(mDataSet, mintBoundTable)
End If
Catch errobj As Exception
Throw errobj
End Try
End Sub First the procedure tests if ...
Read now
Unlock full access