Click to See Complete Forum and Search --> : ADO.NET


biot
March 28th, 2002, 02:29 AM
hi
why this code fails:

Private Sub SaveData()
Dim SelectSTR As String = "Select * From Customers"
Dim Adapter As New OleDb.OleDbDataAdapter(SelectSTR, ConnSTR)
Dim dsCustomer As New DataSet()
Dim DT As DataTable = dsCustomer.Tables("Customer")
Dim ROW As DataRow
ROW("A_ID") = txtID.Text
DT.Rows.Add(ROW)
Adapter.Update(dsCustomer)
End Sub

Craig Gemmill
March 29th, 2002, 12:37 PM
The only thing I can see is that you did not declare 'ConnStr' in:

Dim Adapter As New OleDb.OleDbDataAdapter(SelectSTR, ConnSTR)

Good Luck

biot
March 30th, 2002, 05:08 AM
it was declared in a module using the "Public" statement