Hi I'm using a
to connect to an access database.
The following code *is* working
Since this is a copy from one dataset to another, I would like to simplify the code some... So, this is what I have so far
The copy works, I can access the data in the DB.ds_B dataset just fine after that command. However I believe I'm missing something, as the Update code doesn't actually update the database with the new information (no errors or anything)....
Could anyone please point me in the right direction?
Thanks
VB.NET:
OleDb.OleDbConnection()
The following code *is* working
VB.NET:
Dim cb As New OleDb.OleDbCommandBuilder(DB.da_B)
dsNewRow = DB.ds_B.Tables("B_Data").NewRow()
dsNewRow.Item("Name") = DB.ds_A.Tables("A_Data").Rows(0).Item(0)
dsNewRow.Item("1") = DB.ds_A.Tables("A_Data").Rows(0).Item(1)
dsNewRow.Item("2") = DB.ds_A.Tables("A_Data").Rows(0).Item(2)
DB.ds_B.Tables("B_Data").Rows.Add(dsNewRow)
DB.da_B.Update(DB.ds_B, "B_Data")
DB.ds_B.AcceptChanges()
Since this is a copy from one dataset to another, I would like to simplify the code some... So, this is what I have so far
VB.NET:
Dim cb As New OleDb.OleDbCommandBuilder(DB.da_B)
DB.ds_B = DB.ds_A.Copy
DB.da_B.Update(DB.ds_B, "B_Data")
DB.ds_B.AcceptChanges()
The copy works, I can access the data in the DB.ds_B dataset just fine after that command. However I believe I'm missing something, as the Update code doesn't actually update the database with the new information (no errors or anything)....
Could anyone please point me in the right direction?
Thanks