7,763
社区成员
发帖
与我相关
我的任务
分享
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "" || comboBox1.Text == "")
MessageBox.Show("提示:请输入!", "警告");
else
{
if (this.comboBox1.Text == "学号")
{
string str = @"Data Source=lenovo-pc\sqlexpress;Initial catalog=用户;integrated Security=True";
SqlConnection conn = new SqlConnection(str);
conn.Open();
string sql = "Delete from 成绩信息 where 学号 = '" + textBox1.Text + "'";
SqlCommand cmd = new SqlCommand(sql, conn);
conn.Close();
}
}
}