CSharp:using
lastmod 2021-01-19created 2021-01-192 edits
Notes on the using syntax of C#.
using Directive
Used to Import types defined in another namespace, or to create an alias for a namespace.
using Statement
Used to define the scope of an object. Once it goes out of that scope, it is Disposed automatically.
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command = new SqlCommand(queryString, connection);
command.Connection.Open();
command.ExecuteNonQuery();
}