SqlConnection con = new SqlConnection(cn.ConnectionStrings); GridViewRow row = (GridViewRow)grdLead.Rows[e.RowIndex]; int userid = Convert.ToInt32(grdLead.DataKeys[e.RowIndex].Value.ToString()); Label lblLedId = (Label)grdLead.FindControl("lblLedId"); TextBox txtleadid = (TextBox)row.Cells[0].Controls[0]; TextBox txtfirstname = (TextBox)row.Cells[1].Controls[0]; TextBox txtdate = (TextBox)row.Cells[5].Controls[0]; TextBox txtstatus = (TextBox)row.Cells[6].Controls[0]; TextBox txtrevenue=(TextBox)row.Cells[3].Controls[0]; TextBox txtproduct=(TextBox)row.Cells[4].Controls[0]; TextBox txtowner = (TextBox)row.Cells[7].Controls[0]; TextBox txtcompany = (TextBox)row.Cells[2].Controls[0]; GridView1.EditIndex = -1; con.Open(); string QUERY=" UPDATE [WebCrm].[dbo].[tbl_Lead] SET FirstName='" + txtfirstname.Text + "', Date='" +Convert.ToDateTime(txtdate.Text) + "', Status='" + txtstatus.Text + "',PotentialRevenue='" + txtrevenue.Text + "',ProductInterest='" + txtproduct.Text + "', Owner='" + txtowner.Text + "',Company='" + txtcompany.Text + "' where LedId=" + userid + ""; SqlCommand cmd = new SqlCommand(QUERY, con); cmd.ExecuteNonQuery(); con.Close();
TextBox txtdate = (TextBox)row.Cells[5].Controls[0];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)