protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { //june25 GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex]; Label lblID = (Label)row.FindControl("lblID"); //Image Image = (Image)row.FindControl("Image1"); TextBox textName = (TextBox)row.FindControl("txtName"); TextBox textDesc = (TextBox)row.FindControl("txtDesc"); TextBox textImage = (TextBox)row.FindControl("txtImage"); TextBox textActive = (TextBox)row.FindControl("txtActive"); TextBox textCreatedBy = (TextBox)row.FindControl("txtCreatedBy"); TextBox textCreatedDate = (TextBox)row.FindControl("txtCreatedDate"); FileUpload FileUpload2 = (FileUpload)row.FindControl("FileUpload2"); //FileUpload FileUpload2 = (FileUpload)GridView1.Rows[e.RowIndex].FindControl("FileUpload2"); GridView1.EditIndex = -1; conn.Open(); //SqlCommand cmd = new SqlCommand("UPDATE tbl_SqlImage set Name='" + textName.Text + "' , Description='" + textDesc.Text + "' , Image='" + textImage.Text + "' , Active='" + textActive.Text + "' , CreatedBy='" + textCreatedBy.Text + "' , CreatedDate='" + textCreatedDate.Text + "' where ID='" + lblID.Text.Trim() + "' ", conn); SqlCommand cmd = new SqlCommand("UPDATE tbl_SqlImage set Name='" + textName.Text + "' , Description='" + textDesc.Text + "' , Image='" + textImage.Text + "' , Active='" + textActive.Text + "' , CreatedBy='" + textCreatedBy.Text + "' , CreatedDate='" + textCreatedDate.Text + "' where ID='" + lblID.Text.Trim() + "' ", conn); cmd.ExecuteNonQuery(); conn.Close(); bind(); GridView1.DataBind(); //june25
ViewState
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)