更改数据库客户密码的操作
请大家帮忙看看?的地方该如何填写相应代码?
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text != " " && textBox2.Text != " " && textBox3.Text != " ")
{
if (textBox1.Text == ?)//个人觉得是数据库该表中的数据,但是不之怎末写??
{
if (textBox2.Text == textBox3.Text)
{
SqlConnection Conn = new SqlConnection( "Data Source=(local);Integrated Security=SSPI;Initial Catalog=myaa ");
SqlCommand cmd = new SqlCommand( "update tb_Admini set pwd= ' " + textBox2.Text + " ' where id= ' " ?(这里怎末写sql语句) " ' ", Conn);
Conn.Open();
cmd.ExecuteNonQuery();
Conn.Close();
?(这里对应这么写) = textBox2.Text;
MessageBox.Show( "新口令设置成功! ", "信息提示 ");
Close();
}
else
{
MessageBox.Show( "两次密码输入不同! ", "信息提示 ");