我正在尝试更新数据,但它显示错误。
protected void Button2_Click(object sender, EventArgs e)//Update
{
{
SqlConnection con = new SqlConnection(@"Data Source=SYSTEM2\SQLEXPRESS;Initial Catalog=amresh;Integrated Security=True");
SqlCommand cmd = new SqlCommand("UPDATE detail SET name='" + TxtBox_name.Text + "',address='" + TexBo_add.Text + "', WHERE contact_no='" + TexBo_num.Text + "'",con);
con.Open();
cmd.ExecuteNonQuery();
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('record updated');", true);
con.Close();
}
}