L
Lasse Eskildsen
Hi,
In vb.net, I have a dataset, which I make changes to. When I add a row and
update the database, it's ok, but when I delete or edit a row, i get the
following errormessage: "Object reference not set to an instance of an
object."
on this line:
OleDbDataAdapter1.DeleteCommand.CommandText = "DELETE FROM Person WHERE
Id='26'"
In short, my update looks like this:
Dim newdataset As New DataSet()
newdataset = DataSet11.GetChanges
Me.BindingContext(DataSet11, "person").EndCurrentEdit()
OleDbDataAdapter1.DeleteCommand.CommandText = "DELETE FROM Person WHERE
Id='26'" 'This is the line!
OleDbDataAdapter1.Update(newdataset, "person")
I hope someone can help me solve this (I've just updated from vb6 to vb.net)
Thanks in advance!
In vb.net, I have a dataset, which I make changes to. When I add a row and
update the database, it's ok, but when I delete or edit a row, i get the
following errormessage: "Object reference not set to an instance of an
object."
on this line:
OleDbDataAdapter1.DeleteCommand.CommandText = "DELETE FROM Person WHERE
Id='26'"
In short, my update looks like this:
Dim newdataset As New DataSet()
newdataset = DataSet11.GetChanges
Me.BindingContext(DataSet11, "person").EndCurrentEdit()
OleDbDataAdapter1.DeleteCommand.CommandText = "DELETE FROM Person WHERE
Id='26'" 'This is the line!
OleDbDataAdapter1.Update(newdataset, "person")
I hope someone can help me solve this (I've just updated from vb6 to vb.net)
Thanks in advance!