鉴于以下情况:
try
{
using (var connection = new SqlConnection(_connectionString))
{
connection.Open();
using (SqlCommand queryCommand = new SqlCommand(QueryString, connection))
{
queryCommand.ExecuteScalar();
}
}
}
catch (Exception ex)
{
//logging occurs
}
如果.ExecuteScalar()
方法抛出异常,连接会保持打开状态吗?