protected void ImageButton1_Click(object sender, object e)
{
updateSQL = "UPDATE job_die set ";
updateSQL += "dieno=@dieno,templateno=@templateno,model=@model,type=@type,brassfemaleembossin=@brassfemaleembossin,";
updateSQL += "brassmaleembossing=@brassmaleembossing,supplier=@supplier,lcutterwidth=@lcutterwidth,lcutterlength=@lcutterlength,comment=@comment,";
updateSQL += "lmacross=@lmacross,lmaround=@lmaround,caditemidno=@caditemidno,cadrefno=@cadrefno ,cadnoups=@cadnoups,cadpackheight=@cadpackheight,";
updateSQL += "cadpackwidth=@cadpackwidth,cadpackbreadth=@cadpackbreadth,caddesignheight=@caddesignheight,caddesignwidth=@caddesignwidth,cadgripperwidth=@cadgripperwidth ,";
updateSQL += "cadgripperlenth=@cadgripperlenth,cadchargenno=@cadchargenno WHERE id=@id ";
dbConn2.ConnectionString = constr;
cmd1.Connection = dbConn2;
cmd1.CommandText = updateSQL;
cmd1.CommandType = CommandType.Text;
cmd1.Parameters.AddWithValue("@dieno", TextBox1.Text);
cmd1.Parameters.AddWithValue("@templateno", TextBox2.Text);
cmd1.Parameters.AddWithValue("@model", TextBox3.Text);
cmd1.Parameters.AddWithValue("@type", TextBox4.Text);
cmd1.Parameters.AddWithValue("@brassfemaleembossin", TextBox5.Text);
cmd1.Parameters.AddWithValue("@brassmaleembossing", TextBox6.Text);
cmd1.Parameters.AddWithValue("@supplier", TextBox7.Text);
cmd1.Parameters.AddWithValue("@lcutterwidth", TextBox8.Text);
cmd1.Parameters.AddWithValue("@lcutterlength", TextBox9.Text);
cmd1.Parameters.AddWithValue("@comment", TextBox10.Text);
cmd1.Parameters.AddWithValue("@lmacross", TextBox11.Text);
cmd1.Parameters.AddWithValue("@lmaround", TextBox12.Text);
cmd1.Parameters.AddWithValue("@caditemidno", TextBox13.Text);
cmd1.Parameters.AddWithValue("@id", Session["sid"].ToString());
cmd1.Parameters.AddWithValue("@cadrefno", TextBox14.Text);
cmd1.Parameters.AddWithValue("@cadnoups", TextBox15.Text);
cmd1.Parameters.AddWithValue("@cadpackheight", TextBox16.Text);
cmd1.Parameters.AddWithValue("@cadpackwidth", TextBox17.Text);
cmd1.Parameters.AddWithValue("@cadpackbreadth", TextBox18.Text);
cmd1.Parameters.AddWithValue("@caddesignheight", TextBox19.Text);
cmd1.Parameters.AddWithValue("@caddesignwidth", TextBox20.Text);
cmd1.Parameters.AddWithValue("@cadgripperwidth", TextBox21.Text);
cmd1.Parameters.AddWithValue("@cadgripperlenth", TextBox22.Text);
cmd1.Parameters.AddWithValue("@cadchargenno", TextBox23.Text);
try
{
dbConn2.Open();
int updated = cmd1.ExecuteNonQuery();
Label71.Visible = true;
Label71.Text = updated.ToString() + " records updated.";
// Call the BindUserDetails to refresh the data.
BindUserDetails();
// Or Set UseAccessibleHeader and HeaderRow TableSection
gvDetails.UseAccessibleHeader = true;
gvDetails.HeaderRow.TableSection = TableRowSection.TableHeader;
}
catch (Exception err)
{
Response.Redirect(err.Message);
}
finally
{
dbConn2.Close();
}
}