blah blah blah is here! blah blah » Close

up0down
link

I have a message box that pops up (as the code below) for when a user clicks a button, now if they click yes the save code doesn't work for some reason? but if i remove the message box code and execute the save code it works?

I want the user to click yes the message box closes and executes the code, can anyone see something obvious with the below code why it doesn't function?

DialogResult yourAnswer = MessageBox.Show("NO SALE, is this correct?", "Caption",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (yourAnswer == DialogResult.Yes)
{
this.Validate();
this.salesBindingSource.EndEdit();
this.tableAdapterManager1.UpdateAll(this.saleDataSet);
this.saleDataSet.Clear();
this.textBox1.Text = null;




}
else
{
//Do something else


}

last answered 7 months ago

1 answers

up1down
link

the messagebox is correct, check the saving code or any external code that has an effect on it.

I've tried the save code in a straight forward button click and it works ok, but for some reason in this message box code it doesn't save after clicking yes?

Ahh - muster you was right, on closer inspection it was my filter that was returning the data, it was going in the database all along!Thanks.

Feedback