The typical query execution pattern I inherited is like so:
using (IDataReader r = query.ExecuteReader())
{
while (r.Read())
{
// etc.
}
}
Is query.Connection
left open after the using
block is exited?
No; the connection will not be closed until you dispose the connection.
However, if you pass CommandBehavior.CloseConnection
, the connection will be closed.