using (SqlConnection connection = new SqlConnection( @"Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;")) { connection.Open(); // Do work here; connection closed on following line. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)