protected void ResultGridView_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
TextBox txtFName = (TextBox)ResultGridView.Rows[e.RowIndex].FindControl("txtFName");
TextBox txtLName = (TextBox)ResultGridView.Rows[e.RowIndex].FindControl("txtLName");
TextBox txtCity = (TextBox)ResultGridView.Rows[e.RowIndex].FindControl("txtCity");
TextBox txtState = (TextBox)ResultGridView.Rows[e.RowIndex].FindControl("txtState");
TextBox txtCountry = (TextBox)ResultGridView.Rows[e.RowIndex].FindControl("txtCountry");
TextBox txtDescription = (TextBox)ResultGridView.Rows[e.RowIndex].FindControl("txtDescription");
cmd.Connection = con;
cmd.CommandText = "Update Vendors Set VendorFName = '" + txtFName.Text + "',VendorLName = '" + txtLName.Text + "',VendorCity = '" + txtCity.Text + "',VendorState = '" + txtState.Text + "',VendorCountry = '" + txtCountry.Text + "',VendorDescription = '" + txtDescription.Text + "' where VendorId = " + ResultGridView.DataKeys[e.RowIndex].Values[0].ToString() + "";
con.Open();
cmd.ExecuteNonQuery();
ResultGridView.EditIndex = -1;
FillVendorGrid();
con.Close();
From the above what is the error please correct it.

Blocked AccountRank #403 · 6.2K reputationPosted Nov 28, 2012, 12:21 AM EST
Put the break point on your code and check either you are getting the textbox object or not after finding in the gridview.
Suppose it's null and you try to use txtFName.Text
in that case this will throw, common known error("Object reference Not Set To an instance of object"
Sachin KaliaRank #102 · 20.8K reputationPosted Nov 28, 2012, 3:03 AM EST
there might be a value in .text format.
Could you please share me in which line you are getting this error.
Cheers .Net
Blocked AccountRank #403 · 6.2K reputationPosted Nov 28, 2012, 4:55 PM EST
Can you post code here for better understanding of your code?
Thanks