TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
CJ
NA
42
0
Application.Exit
Nov 8 2005 2:51 PM
I want to exit a procedure if an exception occurs. But this is not working. The app continues to run through the procedure. How can I make it work?
Code:
try
{
sqlConnection1.Open();
}
catch (System.Data.SqlClient.SqlException e2)
{
MessageBox.Show("Exception Thrown: " + e2 + ". Check permissions.");
//enter code to shut down app
this.Close();
Application.Exit();
}
catch (Exception e3)
{
MessageBox.Show("Exception Thrown: " + e3);
//enter code to shut down app
this.Close();
Application.Exit();
}
Thanks,
cj
Reply
Answers (
1
)
help : how to create a thumbnail view
Passing Variables