Link to home
Start Free TrialLog in
Avatar of Parth48
Parth48Flag for India

asked on

what are the ways to catch exceptions in C#.net windows application ??

i want to know that what are the types of exceptions ??
and what are the ways to catch exceptions in C#.net windows application ??

in my applications exceptions generate when i click on exe file (packaging file),
but i don't know how to catch that runtime exception ??
Avatar of Parth48
Parth48
Flag of India image

ASKER

here i attach the exception snapshot ....

please refer the attached snapshot ....

and tell me what can i do ??

23-02-2011-5-56-55-PM.jpg
This should help you out...I know it did me.  Talks about how to handle Unhandled Exceptions.  You don't necessarily have to take screenshots and such...
http://msdn.microsoft.com/en-us/vbasic/cc411437
Avatar of mkobrin
mkobrin

You need to use a try catch finally statement:

try
{
//your code here
}
catch(Exception ex)
{
//your exception handing here
//ex.Message is your error
}
finally
{
//any code here to clean up anything that may need to be cleaned up
}
Sorry, I couldn't find the same video for C#...so here it a converter if you need it.
http://www.developerfusion.com/tools/convert/vb-to-csharp/
ASKER CERTIFIED SOLUTION
Avatar of Sudhakar Pulivarthi
Sudhakar Pulivarthi
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial