消息框未出现在我的屏幕上,它一直停留在我的任务栏中,直到我点击它。有没有办法提示它打开而不点击任务栏中的框。 一旦我点击确定,有没有办法可以刷新页面?
{
string selection_price = DdPetPist.SelectedValue;
var myquery = string.Format("UPDATE Animals SET Stock = Stock - 1 WHERE Specie ='{1}' and Country ='{0}'", ddlcountry.SelectedItem.ToString().Trim(), selection_price);
da.InsertCommand = new MySqlCommand("INSERT INTO Customer(FirstName,LastName,Donation,Email,Adress,TellNo,DATE,Country,Specie) VALUES (@FirstName,@LastName,@Donation,@Email,@Adress,@TellNo,@DATE,@Country,@Specie)", cs);
da.InsertCommand.Parameters.AddWithValue("@FirstName", firstname.Text);
da.InsertCommand.Parameters.AddWithValue("@LastName", lastname.Text);
da.InsertCommand.Parameters.AddWithValue("@Donation", donation.Text);
da.InsertCommand.Parameters.AddWithValue("@Country", ddlcountry.SelectedValue);
da.InsertCommand.Parameters.AddWithValue("@Specie", DdPetPist.SelectedValue);
cs.Open();
da.InsertCommand.ExecuteNonQuery();
using (MySqlCommand cmd = new MySqlCommand(myquery, cs))
cmd.ExecuteNonQuery();
cs.Close();
MessageBox.Show
("Thank you for adopted a pet");
}