c# SQL数据操作问题为什么删除会失败

2025-12-06 11:35:56
推荐回答(1个)
回答1:

objCmd = new SqlCommand("delete from student where student_id = '" + textBox1.Text + "' or Nname = '" + textBox2.Text + "'",objCn);
objCmd.CommandType = CommandType.Text;
try
{
objCmd.ExecuteNonQuery();
MessageBox.Show("删除成功");
}
catch
{
MessageBox.Show("删除失败");
}
}
sf
sb
sbsb

s
路过