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();
}
}
}
uj5u.com熱心網友回復:
權限問題。我猜。轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/66927.html
標籤:VB基礎類
