Hi,
here a sample code for exception handling in C#. but there is have lot of default exception methods are available in c#. do one thing you have to find out what type of exception occurred in catch black like DivideByZeroException and so on.. then only you will take decision in throw block...
cool,
senthil J
Softcrylic technology solutions india pvt ltd.,
using System;
class MyClient
{
public static void Main()
{
int x = 0;
int div = 0;
try
{
div = 100/x;
Console.WriteLine("Not executed line");
}
catch(DivideByZeroException de)
{
Console.WriteLine("Exception occured");
}
finally
{
Console.WriteLine("Finally Block");
}
Console.WriteLine("Result is {0}",div);
}
}