G
Gary Paris
I have a bound datagrid on my windowsform. I have the following
declarations in the global module of the project:
Public eDS As DataSet
Public eDA As OleDb.OleDbDataAdapter
In the Load routine of the form, I have the following code
Dim eDS As New DataSet
Dim eDA As New OleDbDataAdapter
Dim e_strSQL As String
e_strSQL = "SELECT sysid, newDate, newTime , [desc] FROM event
WHERE con_id = '" & _
g_ContactID & "' ORDER BY newDate DESC"
eDA = New OleDbDataAdapter(e_strSQL, CN)
eDA.Fill(eDS, "Event")
Dim cb As New OleDbCommandBuilder(eDA)
DataGrid1.DataSource = eDS
DataGrid1.DataMember = eDS.Tables(0).TableName
This code works, and the table is filled.
When I try to update, using the following code, I get an error, "Object
reference not set to an instance of an object"
eDA.Update(eDS, "Event")
What am I missing?
Thanks,
Gary
declarations in the global module of the project:
Public eDS As DataSet
Public eDA As OleDb.OleDbDataAdapter
In the Load routine of the form, I have the following code
Dim eDS As New DataSet
Dim eDA As New OleDbDataAdapter
Dim e_strSQL As String
e_strSQL = "SELECT sysid, newDate, newTime , [desc] FROM event
WHERE con_id = '" & _
g_ContactID & "' ORDER BY newDate DESC"
eDA = New OleDbDataAdapter(e_strSQL, CN)
eDA.Fill(eDS, "Event")
Dim cb As New OleDbCommandBuilder(eDA)
DataGrid1.DataSource = eDS
DataGrid1.DataMember = eDS.Tables(0).TableName
This code works, and the table is filled.
When I try to update, using the following code, I get an error, "Object
reference not set to an instance of an object"
eDA.Update(eDS, "Event")
What am I missing?
Thanks,
Gary