Z
ZoombyWoof
Hi.
I'm pretty new to C# so this may seem like the dumbest question
today, but I'm stuck.
I have a small application, one Form that opens a connection to
a database in its constructor. If the connection goes wrong I
display a messagebox and I want the application to end after the user
clicks OK.
I cant make that happen.....
If I use Application.Exit in my constructor the form still lives,
if I do a this.dispose the program crashes and the debugger throws up on
me, pointing to the row after Application.Run(blabla) in main.
Application.ExitThread doesnt work either.
How can I kill my program from the Form:s constructor ?
Any help would be much appreciated. Thanx
/ZW
I'm pretty new to C# so this may seem like the dumbest question
today, but I'm stuck.
I have a small application, one Form that opens a connection to
a database in its constructor. If the connection goes wrong I
display a messagebox and I want the application to end after the user
clicks OK.
I cant make that happen.....
If I use Application.Exit in my constructor the form still lives,
if I do a this.dispose the program crashes and the debugger throws up on
me, pointing to the row after Application.Run(blabla) in main.
Application.ExitThread doesnt work either.
How can I kill my program from the Form:s constructor ?
Any help would be much appreciated. Thanx
/ZW