J
Jeff Brown
Does anyone else ever feel like just giving up!!!!!
When i edit a record and then update the database i get an error, although i
can add a new record completely.
The error is : An unhandled exception of type
'System.InvalidOperationException' occurred in system.data.dll
no additional info i can see
Here is the update code i am using
:
' Temporary DataSets to store the inserted or modified row.
Dim pdsInsertedRows, pdsModifiedRows As DataSet
' Set the menu items to indicate that a record is being edited.
Call EditState(cblnNotEditing)
' End editing on the current record.
Me.BindingContext(DsTrailers1, "equiptrailers").EndCurrentEdit()
' Copy the DataSets by getting the added or modified records from the
' original bound DataSet.
pdsInsertedRows = DsTrailers1.GetChanges(DataRowState.Added)
pdsModifiedRows = DsTrailers1.GetChanges(DataRowState.Modified)
' Check to see if there is an inserted row. If there is update DataSet.
If Not pdsInsertedRows Is Nothing Then
odbdaTrailers.Update(pdsInsertedRows)
End If
**********************************************
THE ERROE THORWS HERE ON THE END IF STAEMENT
' Check to see if there is a modified row. If there is update dataset
If Not pdsModifiedRows Is Nothing Then
odbdaTrailers.Update(pdsModifiedRows)
End If
**********************************************
' Synchronize the database
DsTrailers1.AcceptChanges()
When i edit a record and then update the database i get an error, although i
can add a new record completely.
The error is : An unhandled exception of type
'System.InvalidOperationException' occurred in system.data.dll
no additional info i can see
Here is the update code i am using
:
' Temporary DataSets to store the inserted or modified row.
Dim pdsInsertedRows, pdsModifiedRows As DataSet
' Set the menu items to indicate that a record is being edited.
Call EditState(cblnNotEditing)
' End editing on the current record.
Me.BindingContext(DsTrailers1, "equiptrailers").EndCurrentEdit()
' Copy the DataSets by getting the added or modified records from the
' original bound DataSet.
pdsInsertedRows = DsTrailers1.GetChanges(DataRowState.Added)
pdsModifiedRows = DsTrailers1.GetChanges(DataRowState.Modified)
' Check to see if there is an inserted row. If there is update DataSet.
If Not pdsInsertedRows Is Nothing Then
odbdaTrailers.Update(pdsInsertedRows)
End If
**********************************************
THE ERROE THORWS HERE ON THE END IF STAEMENT
' Check to see if there is a modified row. If there is update dataset
If Not pdsModifiedRows Is Nothing Then
odbdaTrailers.Update(pdsModifiedRows)
End If
**********************************************
' Synchronize the database
DsTrailers1.AcceptChanges()