indradeo says:
if
(cb.Checked)
{
string
cisf_flag = cb.Checked ?
"Y"
:
"N"
;
string
constr = ConfigurationManager.ConnectionStrings[
"constr"
].ConnectionString;
using
(SqlConnection con =
new
SqlConnection(constr))
{
SqlCommand cmd =
new
SqlCommand(
"UPDATE Customers SET cisf_flag = @cisf_flag where pass_id=@pass_id"
);
cmd.Connection = con;
cmd.Parameters.AddWithValue(
"@cisf_flag"
, cisf_flag);
cmd.Parameters.AddWithValue(
"@pass_id"
, pass_id);
con.Open();
string
isUpdated = Convert.ToString(cmd.ExecuteNonQuery());
con.Close();
}
}
You need to set the row visible property. Change with below code.
if (cb.Checked)
{
string cisf_flag = cb.Checked ? "Y" : "N";
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
SqlCommand cmd = new SqlCommand("UPDATE Customers SET cisf_flag = @cisf_flag where pass_id=@pass_id");
cmd.Connection = con;
cmd.Parameters.AddWithValue("@cisf_flag", cisf_flag);
cmd.Parameters.AddWithValue("@pass_id", pass_id);
con.Open();
string isUpdated = Convert.ToString(cmd.ExecuteNonQuery());
con.Close();
}
row.Visible = fasle;
}