我要请高手们指教了,我怎么改啊
private void button4_Click(object sender, System.EventArgs e)
{
SqlConnection conn = new SqlConnection("server=aaa;database=human;uid=sa;password=sys1369");
conn.Open();
SqlCommand cd = new SqlCommand("update dept set dept='"+textBox1.Text+"',chief='"+textBox2.Text+"',tel='"+textBox3.Text+"',duty='"+textBox4.Text+"' where dept='"+textBox5.Text+"'",conn);
string message="确定修改吗?修改请按yes.";
string caption="提示信息!";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result;
result=MessageBox.Show(this,message,caption,buttons,MessageBoxIcon.Warning,MessageBoxDefaultButton.Button1,MessageBoxOptions.RightAlign);
if (result == DialogResult.Yes)
{
cd.ExecuteNonQuery();
conn.Close();
MessageBox.Show("修改成功!");
dataGrid1.Refresh();
}
}
我有一段SQL代码是要做"修改"的功能的,但是我想改成ACCESS库的