Hi Vijay, Using statement basically defines the scope of the object created and at the end of which the object is disposed. When you create an object that binds itself to a resource, typically like a database connection or file handle, you have to make sure that you call the dispose method of that object when you are done with it. This is typically done in the finally block, which always gets executed. C# language provides using statement, which does the same implicitly. At the end of the object's scope, the dispose method is called automatically. This is typically used for objects whose life time is short and does not exists beyond that method like your database connection, comand object.... If your code throws an exception and leaves the block, the object will be automatically destroyed as its scope is over. The runtime guarentees this. Need any help, do post a msg back. Happy coding. |