I am looking at a code snippet in an application, and I came up with something very strange with regards to connecting to a database.
Executes queries without opening a connection as follows:
using (sqlConnection1 = new SqlConnection(connString) { SqlCommand comm = new SqlCommand(query,sqlConnection1);
Is this not so, because the connection is not open? I really tested this in a separate project and it worked.
source share