Posted on: 7/20/2013 10:01:42 AM | Views : 227

I got the below error message while updating the value on the gridview:
"Object reference not set to an instance of an object"
And my c# code is:
protected void gvDetails_RowUpdating(object sender, GridViewUpdateEventArgs e) {  int nmbr = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());  TextBox name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("names");  TextBox dept = (TextBox)GridView1.Rows[e.RowIndex].FindControl("depts");  TextBox quantity = (TextBox)GridView1.Rows[e.RowIndex].FindControl("quantitys"); con.Open();  SqlCommand cmds = new SqlCommand("update erbp set name ='" + name.Text + "',dept ='"+ dept.Text+"',quantity='" + quantity.Text + "' where in ...

Go to the complete details ...