在按钮事件里写:
string sqlstr = "Data Source=(Local);database=数据库;Integrated Security=True";
SqlConnection con = new SqlConnection(sqlstr);
con.Open();
string up = "update 数据表 set [列名]='"+textBox9.Text.ToString()+"'";
SqlCommand com = new SqlCommand(up,con);
com.ExecuteNonQuery();
con.Close();
MessageBox.Show(" 更 新 ‘ 一 周 看 点 ’ 成 功 !" ," 温 馨 提 示 " );
string sqlstr = "Data Source=(Local);database=数据库;Integrated Security=True";
SqlConnection con = new SqlConnection(sqlstr);
con.Open();
string up = "update 数据表 set [列名]='"+textBox9.Text.ToString()+"'";
SqlCommand com = new SqlCommand(up,con);
com.ExecuteNonQuery();
con.Close();
MessageBox.Show(" 更 新 ‘ 一 周 看 点 ’ 成 功 !" ," 温 馨 提 示 " );