Weird 'incorrect syntax near WHERE' message from MessageBox

L

Larry Woods

I have a Messagebox that looks like:

MessageBox.Show("There are pending changes for this patient. Do you want to
continue to close?", "Pending Changes", MessageBoxButtons.YesNo,
MessageBoxIcon.Question)

When I execute the Messagebox.Show, then press either 'Yes' or 'No' I get 25
of the following Messageboxes:

"incorrect syntax near the keyword WHERE"

I am sure that this is tied to some other problem in my form but I have NO
clue where. I have put breakpoints before and after the Messagebox.Show so
I know that the problem occurs in the Messagebox execution. I am working
with a dataset in this form but the dataset table has 21 fields so I can't
see any correlation with that table.

ANY IDEAS?

??????????????????????

TIA,

Larry Woods
 
L

Larry Woods

Nope! Turns out that I added the two additional parameters that were part
of another cast of MessageBox and it works fine! After sending my original
email I moved the Messagebox around at different places in the program and
at one place it just kept displaying my original MessageBox message 25
times!!!! It's obvious that it is somewhere tied with what I am doing in my
program but I am surprised that Messagebox is getting so screwed
up...considering the protections that are built into the .NET framework.

Larry
 
L

Larry Woods

I stand corrected.

I have my initialization code in the form Activate event procedure instead
of the Load procedure...and it's reentering the procedure.

Larry
 
C

CJ Taylor

=) So is the problem solved?


Larry Woods said:
I stand corrected.

I have my initialization code in the form Activate event procedure instead
of the Load procedure...and it's reentering the procedure.

Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top