protected void Update(object sender, EventArgs e)
{
foreach (GridViewRow row in gvStudeff.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
bool isChecked = row.Cells[0].Controls.OfType<CheckBox>().FirstOrDefault().Checked;
if (isChecked)
{
SqlCommand cmd = new SqlCommand("UPDATE studentF1 SET qi1 = @ContactName, ename = @Country WHERE idsd = @CustomerId");
cmd.Parameters.AddWithValue("@ContactName", row.Cells[1].Controls.OfType<TextBox>().FirstOrDefault().Text);
cmd.Parameters.AddWithValue("@Country", row.Cells[2].Controls.OfType<DropDownList>().FirstOrDefault().SelectedItem.Value);
cmd.Parameters.AddWithValue("@CustomerId", gvStudeff.DataKeys[row.RowIndex].Value);
this.ExecuteQuery(cmd, "SELECT");
}
}
}
btnUpdate.Visible = false;
this.BindGrid();
}
where qi1 (numeric(10,1)