Exception is the used to handle the error.
You can handle the error using the try catch.
eg;
try
{
}
catch (exception ex)
{
throw ex;
}
In the above code first you try to get the result...
If any error occurred while trying to find the result say connection loss while retrieving the data
then it will catch the error i.e exception and throw the error as the message.
well this is not the way to handle the error.
you can do...
try
{
}
catch (exception ex)
{
Console.WriteLine(ex.message);
Console.Read();
}
I hope this will help you...