假设我有这两个对象:
OracleConnection connection = new OracleConnection(connectionString);
OracleCommand command = new OracleCommand(sql, connection);
要关闭连接或 Oracle,我是否必须调用 command.Dispose()、connection.Dispose() 或两者都调用?
这是否足够好:
using(connection)
{
OracleDataReader reader = cmd.ExecuteReader();
// whatever...
}