hi there, im using the following code to load data into a datagrid and update it, but the update part isnt working fine, any ideas?
Dim conn As New OleDbConnection(connection_str)
conn.Open()
sql_str = "select * from num"
Dim objCommand As New OleDbCommand(sql_str, conn)
Dim DS As New DataSet()
data_adapter = New OleDbDataAdapter(objCommand)
data_adapter.Fill(ds, "to")
DataGrid1.DataSource = ds.Tables("to")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Dim ds As New DataSet()
If ds.HasChanges() Then
MsgBox("yes")
End If
the error msg is :
An unhandled exception of type 'System.NullReferenceException' occurred in datagridexple.exe
Additional information: Object reference not set to an instance of an object.
thank you.




Reply With Quote