when i click on insert link button i'm getting the error "object reference not set to an instance of an object ". As per my knowledge this error causes when there is no data whatever we pass the parameters and when there is no data in a datatable
in that cases i'm facing this type of problems in previously.
But i'm simplly calling the insert click event there is no data in that , why it's showing this error can any one tell me the reasons to get this error.
pranathis
Member
28 Points
136 Posts
Object Reference not set to an instance of an object
Dec 20, 2012 05:12 AM|LINK
Hi ,
this is my source code
asp:LinkButton ID="btninsert" runat="server" onclick="btninsert_Click"> Insert Data</asp:LinkButton>this is my code behind
protected void btninsert_Click(object sender, EventArgs e) { }when i click on insert link button i'm getting the error "object reference not set to an instance of an object ". As per my knowledge this error causes when there is no data whatever we pass the parameters and when there is no data in a datatable in that cases i'm facing this type of problems in previously.
But i'm simplly calling the insert click event there is no data in that , why it's showing this error can any one tell me the reasons to get this error.
and help me how to overcome this issue now...
Thanks in Advance.....
oned_gk
All-Star
36074 Points
7361 Posts
Re: Object Reference not set to an instance of an object
Dec 20, 2012 05:32 AM|LINK
Maybe the problem not from your click event, but from page_load event.
If you bind gv in page load event, posible the error from databound event. I think the problem not from the button.
Suwandi - Non Graduate Programmer
pranathis
Member
28 Points
136 Posts
Re: Object Reference not set to an instance of an object
Dec 20, 2012 05:52 AM|LINK
May be this is the reason i think i will check out my code and then if i face any problem again i caontact u thank u