G
Guest
I have a window Application. this.close(); doesn't stop and close my
application when I get an error. Instead it continues trying to execute the
following codes. What code do I need to the application to exit where it
catches the exception and close down the application?
Thanks, Alpha
conDB = new SqlConnection(conStr);
try
{
conDB.Open();
scUpdate = conDB.CreateCommand();
conDB.Close();
}
catch(Exception ex)
{
MessageBox.Show("Error connecting to the database server. VMS can't run
with out database connection and VMS will be closing down. " + ex.ToString()+
"Please contact your support person.", "VMS - Database Open Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Close();
}
application when I get an error. Instead it continues trying to execute the
following codes. What code do I need to the application to exit where it
catches the exception and close down the application?
Thanks, Alpha
conDB = new SqlConnection(conStr);
try
{
conDB.Open();
scUpdate = conDB.CreateCommand();
conDB.Close();
}
catch(Exception ex)
{
MessageBox.Show("Error connecting to the database server. VMS can't run
with out database connection and VMS will be closing down. " + ex.ToString()+
"Please contact your support person.", "VMS - Database Open Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Close();
}