First off: You should never build queries with parameter injection. This leaves you wide open to SQL injection attacks which can destroy your data. Use parameterized queries instead. This will also help you find the problem:
private const string query1 = @"
UPDATE [WebCrm].[dbo].[tbl_Lead]
SET FirstName=@firstname,
Date=@date,
Status=@status,
PotentialRevenue=@revenue,
ProductInterest=@interest,
Owner=@owner,
Company=@company
where LedId=@ledId";
protected void grdLead_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
SqlConnection con = new SqlConnection(cn.ConnectionStrings);
Label lblLedId = (Label)grdLead.FindControl("lblLedId");
TextBox textLead = (TextBox)grdLead.Rows[e.RowIndex].FindControl("textLead");
TextBox textCompany = (TextBox)grdLead.Rows[e.RowIndex].FindControl("textCompany");
TextBox textProduct = (TextBox)grdLead.Rows[e.RowIndex].FindControl("textProduct");
TextBox textRevenue = (TextBox)grdLead.Rows[e.RowIndex].FindControl("textRevenue");
TextBox textDate = (TextBox)grdLead.Rows[e.RowIndex].FindControl("textDate");
TextBox textStatus = (TextBox)grdLead.Rows[e.RowIndex].FindControl("textStatus");
TextBox textOwner = (TextBox)grdLead.Rows[e.RowIndex].FindControl("textOwner");
string query = query1;
SqlCommand cmd = new SqlCommand(query, con);
cmd.CommandType = CommandType.Text;
cmd.Parameters.Add(new SqlParameter("@firstname", SqlDbType.NVarChar) { Value = textLead.Text });
cmd.Parameters.Add(new SqlParameter("@date", SqlDbType.Date) { Value = textDate.Text });
cmd.Parameters.Add(new SqlParameter("@status", SqlDbType.NVarChar) { Value = textStatus.Text });
cmd.Parameters.Add(new SqlParameter("@revenue", SqlDbType.NVarChar) { Value = textRevenue.Text });
cmd.Parameters.Add(new SqlParameter("@interest", SqlDbType.NVarChar) { Value = textProduct.Text });
cmd.Parameters.Add(new SqlParameter("@owner", SqlDbType.NVarChar) { Value = textOwner.Text });
cmd.Parameters.Add(new SqlParameter("@company", SqlDbType.NVarChar) { Value = textCompany.Text });
cmd.Parameters.Add(new SqlParameter("@ledId", SqlDbType.Int) { Value = lblLedId.Text });
con.Open();
int rowsChanged = cmd.ExecuteNonQuery();
con.Close();
grdLead.EditIndex = -1;
bindLead();
Use that and you will see exactly where the error is.
PS: one of your controls was not found ^_^
UPDATE: You can simplify the method as so:
protected void grdLead_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
SqlConnection con = new SqlConnection(cn.ConnectionStrings);
Label lblLedId = (Label)grdLead.FindControl("lblLedId");
TextBox textLead = (TextBox)e.Row.FindControl("textLead");
TextBox textCompany = (TextBox)e.Row..FindControl("textCompany");
TextBox textProduct = (TextBox)e.Row..FindControl("textProduct");
I'll keep looking into the root issue