I have a VB.NET application that has a ole connection, adapter and dataset. UI is a form that has text boxes that are populated from the database (DbAdapter1.Fill(Dataset)).
On the leave event for the textbox I run this code:
OleDbConnection1.Open()
Debug.WriteLine(dataset.RBIGoals.Rows(0).RowState) 'returns Unchanged
dataset.RBIGoals.Rows(0).BeginEdit()
dataset.Tables("RBIGoals").Rows(0).Item("fldname") = CDbl(tbfield.Text)
Debug.WriteLine(dataset.RBIGoals.Rows(0).RowState) 'returns Unchanged
dataset.RBIGoals.Rows(0).EndEdit()
Debug.WriteLine(dataset.RBIGoals.Rows(0).RowState) 'returns Modified
dataset.RBIGoals.Rows(0).AcceptChanges()
Debug.WriteLine(dataset.RBIGoals.Rows(0).RowState) 'returns Unchanged
DbAdapter1.Update(dataset)
Debug.WriteLine(dataset.RBIGoals.Rows(0).RowState) 'returns Unchanged
OleDbConnection1.Close()
If I look at the data in the dataset it is updated, hoever the data in the underlying database (MS Access) never gets updated.
On the leave event for the textbox I run this code:
OleDbConnection1.Open()
Debug.WriteLine(dataset.RBIGoals.Rows(0).RowState) 'returns Unchanged
dataset.RBIGoals.Rows(0).BeginEdit()
dataset.Tables("RBIGoals").Rows(0).Item("fldname") = CDbl(tbfield.Text)
Debug.WriteLine(dataset.RBIGoals.Rows(0).RowState) 'returns Unchanged
dataset.RBIGoals.Rows(0).EndEdit()
Debug.WriteLine(dataset.RBIGoals.Rows(0).RowState) 'returns Modified
dataset.RBIGoals.Rows(0).AcceptChanges()
Debug.WriteLine(dataset.RBIGoals.Rows(0).RowState) 'returns Unchanged
DbAdapter1.Update(dataset)
Debug.WriteLine(dataset.RBIGoals.Rows(0).RowState) 'returns Unchanged
OleDbConnection1.Close()
If I look at the data in the dataset it is updated, hoever the data in the underlying database (MS Access) never gets updated.