0
我將不勝感激您的答覆。我如何將按鈕添加到消息框?爲了清楚,我有一個按鈕,當我按下保存按鈕時,我得到一個帶有這個文本的消息框:「請...」以及這兩個按鈕,取消和繼續。將幾個按鈕添加到消息框
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Please fill all..."); // I like to add to this messagebox buttons
{
SqlConnection con = new SqlConnection("Data Source=.\\sqlexpress;Initial Catalog=VirtualSalesFair;Integrated Security=True");
con.Open();
SqlCommand sc = new SqlCommand("Insert into Empty value('" + textBox1.Text + "'," + textBox2.Text + ",'" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "','" + textBox7.Text + "','" + textBox8.Text + "','" +textBox9.Text +"',"+textBox10.Text +");", con);
int o=sc.ExecuteNonQuery();
MessageBox.Show(o+ ":Record has been inserted");
con.Close();
}
}