The following code:
Try
da.Update(ds.Ta bles(dg1Name))
Catch ex As Exception
Console.WriteLi ne(ex.ToString)
MessageBox.Show (ex.ToString)
End Try
causes this error:
System.InvalidO perationExcepti on: Update requires a valid UpdateCommand when
passed DataRow collection with modified rows.
at System.Data.Com mon.DbDataAdapt er.Update(DataR ow[] dataRows,
DataTableMappin g tableMapping)
at System.Data.Com mon.DbDataAdapt er.Update(DataT able dataTable)
at comments.Form1. Button1_Click(O bject sender, EventArgs e) in
G:\Shared\VBSha re\dotnet\Kevin \comments\Form1 .vb:line 161
The code is behiend a button on the form called Update. If I change the data
in the grid I get the error when I press the update button. Any advice will
be much appreciated.
Kevin
Try
da.Update(ds.Ta bles(dg1Name))
Catch ex As Exception
Console.WriteLi ne(ex.ToString)
MessageBox.Show (ex.ToString)
End Try
causes this error:
System.InvalidO perationExcepti on: Update requires a valid UpdateCommand when
passed DataRow collection with modified rows.
at System.Data.Com mon.DbDataAdapt er.Update(DataR ow[] dataRows,
DataTableMappin g tableMapping)
at System.Data.Com mon.DbDataAdapt er.Update(DataT able dataTable)
at comments.Form1. Button1_Click(O bject sender, EventArgs e) in
G:\Shared\VBSha re\dotnet\Kevin \comments\Form1 .vb:line 161
The code is behiend a button on the form called Update. If I change the data
in the grid I get the error when I press the update button. Any advice will
be much appreciated.
Kevin
Comment