以下のコードは接続を適切に閉じていますか..
public static bool Hello(string sqlQuery)
{
SqlDataReader dataReader = null;
var isExist = false;
using (var aeConnection = new SqlConnection(ConnectionString))
{
try
{
var aeCommand = new SqlCommand(sqlQuery, aeConnection)
{
CommandType = CommandType.Text
};
aeConnection.Open();
dataReader = aeCommand.ExecuteReader(CommandBehavior.Default);
while (dataReader.Read())
{
int vinCount;
int.TryParse(dataReader["VINCount"].ToString(), out vinCount);
if (vinCount == 0)
{
isExist = true;
}
}
}
catch (Exception ex)
{
if (dataReader != null)
{
dataReader.Close();
}
}
}
return isExist;
}