I have a dataset that I populate from a DB and then modify the local data. How do I take these changes back to the database?
refere to pull data sub() for data loading...
this the update I tried
=====================================================
Private Sub Update_DB()
oOleDbConnection = New OleDb.OleDbConnection(CONN)
oOleDbConnection.Open()
If ConnectionState.Open Then
TextBox1.Text = "Connection is made to Main"
TextBox1.BackColor = Color.Blue
Else
TextBox1.Text = "Unable to make connection"
TextBox1.BackColor = Color.Red
End If
daDTEmp.Update(now, 0)
END SUB 'Update_DB
=====================================================
i receive:
Additional information: Object reference not set to an instance of an object.
Note, after I make a change to a column in the table a have a button that looks at the particular column to assure that the column was update...so I know I am updating the local data..
=====================================================
pull data sub()
....
strDTEmp = "Select * from EMP"
strDTDept = "Select * from DEPT"
Dim daDTEmp = New OleDb.OleDbDataAdapter(strDTEmp, CONN)
Dim daDTDept = New OleDb.OleDbDataAdapter(strDTDept, CONN)
daDTEmp.Fill(now, "EMP")
daDTDept.Fill(now, "DTDept")
oOleDbConnection.Close()
DTEmp = now.Tables(0) ' set up datatable for dataview
end sub 'pull data
=====================================================
thanks
refere to pull data sub() for data loading...
this the update I tried
=====================================================
Private Sub Update_DB()
oOleDbConnection = New OleDb.OleDbConnection(CONN)
oOleDbConnection.Open()
If ConnectionState.Open Then
TextBox1.Text = "Connection is made to Main"
TextBox1.BackColor = Color.Blue
Else
TextBox1.Text = "Unable to make connection"
TextBox1.BackColor = Color.Red
End If
daDTEmp.Update(now, 0)
END SUB 'Update_DB
=====================================================
i receive:
Additional information: Object reference not set to an instance of an object.
Note, after I make a change to a column in the table a have a button that looks at the particular column to assure that the column was update...so I know I am updating the local data..
=====================================================
pull data sub()
....
strDTEmp = "Select * from EMP"
strDTDept = "Select * from DEPT"
Dim daDTEmp = New OleDb.OleDbDataAdapter(strDTEmp, CONN)
Dim daDTDept = New OleDb.OleDbDataAdapter(strDTDept, CONN)
daDTEmp.Fill(now, "EMP")
daDTDept.Fill(now, "DTDept")
oOleDbConnection.Close()
DTEmp = now.Tables(0) ' set up datatable for dataview
end sub 'pull data
=====================================================
thanks