You should use Using statement provided by CSharp. You can touch base with me on http://dotnetpiper.blogspot.in/