and
changed the update parameter slightly to eliminate the decsription not defined error:
this line: pAdapter.Update(name, desc, id);
I've also added a row cancelling event and the cancel event works, but it still throws the above error (Object reference not set to an instance of an object:
string name = e.NewValues["name"].ToString(); when I click on edit
I still seem to be missing something..do you have any ideas?
liza99
0 Points
8 Posts
Re: TableAdapter Update GridView
Apr 09, 2012 10:40 PM|LINK
Thanks again, for replying
Now, however, I am getting this error: Object reference not set to an instance of an object: string name = e.NewValues["name"].ToString();
I've changed my HTML to this:
<asp:GridView ID="GridView1" runat="server"
AutoGenerateEditButton="True"
OnRowEditing="GridView1_RowEditing"
OnRowCancelingEdit="GridView1_RowCancelingEdit"
OnRowUpdating="GridView1_RowUpdating"></asp:GridView>
to eliminate a row editing not handled error,
and changed the update parameter slightly to eliminate the decsription not defined error:
this line: pAdapter.Update(name, desc, id);
I've also added a row cancelling event and the cancel event works, but it still throws the above error (Object reference not set to an instance of an object: string name = e.NewValues["name"].ToString(); when I click on edit
I still seem to be missing something..do you have any ideas?
Thanks for your replies