Link to home
Start Free TrialLog in
Avatar of Information Services
Information ServicesFlag for United States of America

asked on

The Using statement in C#

To date, I've been creating a public static class for connecting to host databases, and passing back a connection object. That entails closing the connection and disposing of all the associated objects.
I recently saw code that showed a using statement; I've really only used "using" declarations at the beginning of my code.
I see all of the examples online but none show the entire code for the class. Is there someone out there who'd like to share?
If you have any tips on implementing, I'm all ears!
SOLUTION
Avatar of Tapan Pattanaik
Tapan Pattanaik
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Dustin Saunders
Dustin Saunders
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Information Services

ASKER

Either one of you that responded ever nest the using statements?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks guys. Appreciate the quick response.