Search This Blog

Tuesday, January 15, 2013

using Statement (C#)

C# > Statements > using

Defines a scope, outside of which an object or object will be disposed.
The using statement allows the programmer to specify when objects that use resources should release them.

Example

using (SqlConnection connection = new SqlConnection(connectionString))
{
   connection.Open();
}