try
{
code which can produce error
}
catch()
{
handle that error generated by try block
}
finally
{
a code which is going to executes in spite of whether error is generated in try block or not
}
you can use finally block to close the connection to databases,files n etc.