JAVA日报

简单.net增删改查(修改)

string str = "";
if (comboBox1.Text.Equals("学号"))
{
str = "xh";
}
else if (comboBox1.Text.Equals("姓名"))
{
str = "name";
}
else if (comboBox1.Text.Equals("住址"))
{
str = "area";
}
else if (comboBox1.Text.Equals("年龄"))
{
str = "age";
}
else if (comboBox1.Text.Equals("电话"))
{
str = "phone";
}
getCom("update information set " + str + "='" + textBox2.Text + "' where " + str + "='" + comboBox2.Text + "'");
MessageBox.Show("修改成功");
show();

posted @ 2021-12-01 21:11  我的未来姓栗山  阅读(12)  评论(0编辑  收藏  举报