我在 Visual Studio 2010 中使用消息框。它在调试模式下工作,但在服务器上不起作用。为什么它不起作用?
if (MessageBox.Show("Invoice sample already exists. Do you want to overwrite it?.", "Overwrite", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification) == DialogResult.OK)
{
dr.Close();
con.Close();
con.Open();
cmd = new SqlCommand("sp_pdm_shopping_upload_update", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@sample", SqlDbType.Char, 10));
cmd.Parameters.Add(new SqlParameter("@image", SqlDbType.Image));
cmd.Parameters.Add(new SqlParameter("@type", SqlDbType.Char, 10));
cmd.Parameters["@sample"].Value = txt_code.Text;
cmd.Parameters["@image"].Value = imgbyte;
cmd.Parameters["@type"].Value = "INV";
cmd.ExecuteNonQuery();
con.Close();
//getuploadinvoice();
//getuploadimage();
ErrorMsg.Visible = true;
ErrorMsg.Text = "The image has been successfully updated.";
}