ADO.net Finally Block

Go back to: Code Samples
try 
{
   DBConn.Open();
 
   // Do some other interesting work
}
catch (Exception ex) 
{
 
   // Handle exceptions
}
finally
{
 
// Close the connection
       if (DBConn != null)
           DBConn.Close();
}




Like what you see? Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • LinkedIn
  • Reddit
  • StumbleUpon
  • Technorati
  • TwitThis

Book Content Copyright © 2009 by Prentice Hall PTR. All rights reserved. | Corporate Sponsor DataDirect Technologies.