I'm using VB.net 2003. I can delete a row in datagrid (dgTempTransact ion), but my MS Access table can't directly being updated. The row i deleted is still exist in my MS Access, but in my datagrid, it already being deleted.
The table name in my MS Access: tableTempTransa ction.
Here is my code for that part...i don't know where is the error. Please help me..... Thanks anyway.
Dim currManager As CurrencyManager
If IsNothing(DsTem pTransaction1) Then Exit Sub
currManager = CType(BindingCo ntext(DsTempTra nsaction1, "tableTempTrans action"), CurrencyManager )
'get the current row
Dim dRow As DataRow = CType(currManag er.Current, DataRowView).Ro w
'prompt to save changes
If MsgBox("Are you sure want to delete this item?", MsgBoxStyle.OKC ancel, "Hands On Programming") = MsgBoxResult.OK Then
'delete it from the dataset
dRow.Delete()
'get just the changed data
Dim dsChanged As DataSet = DsTempTransacti on1.GetChanges
'>>>Problem in this part...table inside MS Access cannot be updated.
Else
'reset the dataset
DsTempTransacti on1.RejectChang es()
End If
The table name in my MS Access: tableTempTransa ction.
Here is my code for that part...i don't know where is the error. Please help me..... Thanks anyway.
Dim currManager As CurrencyManager
If IsNothing(DsTem pTransaction1) Then Exit Sub
currManager = CType(BindingCo ntext(DsTempTra nsaction1, "tableTempTrans action"), CurrencyManager )
'get the current row
Dim dRow As DataRow = CType(currManag er.Current, DataRowView).Ro w
'prompt to save changes
If MsgBox("Are you sure want to delete this item?", MsgBoxStyle.OKC ancel, "Hands On Programming") = MsgBoxResult.OK Then
'delete it from the dataset
dRow.Delete()
'get just the changed data
Dim dsChanged As DataSet = DsTempTransacti on1.GetChanges
'>>>Problem in this part...table inside MS Access cannot be updated.
Else
'reset the dataset
DsTempTransacti on1.RejectChang es()
End If
Comment