I have the following code:
SqlConnection Connect = new SqlConnection(IST_DBConnect.SQLConnectionString);
SqlCommand command = new SqlCommand(sqlCommandString, Connect);
RequestRow Result = new RequestRow();
Connect.Open();
using (Connect)
...
This is not my code, I would write the creation of the SQL Connection in a using statement, this is a code of my friend, I am no exactly sure if this is going to dispose properly the SQL connection object if something goes wrong in the constructor or in the Open method. So my question is if the connection object is created and the open method throws an exception => the connection is never opened, will this be disposed properly?
Thanks.