.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Exception handling

Posted By: Ramesh P     Posted Date: October 19, 2010    Points:2   Category :C#
Explain about exception handling?

Author: Asha.MP             
Posted Date: October 20, 2010     Points: 5   

Exception handling is the process of handling the exception in the application.
a is of type string variable
when you try to convert it into integer you will get the InvalidCastException exception.
you can handle that exception by using try-catch

Dim strVar As String = "Asha"
'strVar is of type string
Dim intVar As Integer = strVar
'Trying to convert string to integer
Catch ex As Exception
'Catching the exception
Console.WriteLine("Error in Convertion")
End Try

Thanks and Regards,
Author: Don             
Posted Date: January 11, 2011     Points: 5   

It is simply putting the code where there is a chance of an exception or error in a try block..Try block will be followed by a single or multiple catch blocks which will catch the exception and handles it properly.
Print("file not found");
I think it is pretty clear now..
It just make sure that application don't end abruptly..
It gives a message to naïve user what has actually happened.

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend