private void button4_Click(object sender, EventArgs e)
{
string un = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
DialogResult dr = MessageBox.Show("确信要为" + un + "初始化密码吗?", "提示...", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (dr == DialogResult.OK)
{
//执行更新语句,密码为123
}
}
//请写下说明和代码结构,其余我会用代码补齐~
------解决思路----------------------
跟你另一个帖子的删除类似,只是改成类似下面的
update users set password=123 where username='abc'