private void button1_Click(object sender, EventArgs e)
{
try
{
string sql1 = " delete from 图书表 where 书号='" + textBox1.Text + "'";
SqlConnection con = new SqlConnection(constr);
SqlCommand cmd = new SqlCommand(sql1, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("您确认删除吗!", "消息框", MessageBoxButtons.YesNoCancel);
textBox1.Text = "";
}
catch
{
MessageBox.Show("删除不成功!", "消息框");
}
StockInformation d = new StockInformation();
d.Show();
}
{
try
{
string sql1 = " delete from 图书表 where 书号='" + textBox1.Text + "'";
SqlConnection con = new SqlConnection(constr);
SqlCommand cmd = new SqlCommand(sql1, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("您确认删除吗!", "消息框", MessageBoxButtons.YesNoCancel);
textBox1.Text = "";
}
catch
{
MessageBox.Show("删除不成功!", "消息框");
}
StockInformation d = new StockInformation();
d.Show();
}