Why call .Close() and .Dispose() on a connection.
562989Jun 4 2007 — edited Apr 1 2010If, by the IDisposeable interface, both Dispose() and Close() are interchangeable, why is it suggested to call both? Why not just do:
using (IDbConnection conn = new OracleConnection("connString"))
{
IDbCommand cmd = conn.CreateCommand();
cmd.ExecuteNonQuery();
}
The using statement will call conn.Dispose(), which in turn calls Close() and releases the unmanaged resources.
Thanks.