public override void Close() { if (!IsClosed) { _isClosed = true; if (_command != null && !_command.IsDisposed) { if (_command.CommandType == CommandType.StoredProcedure) { _command.SetOutputParameters(); } if (_command.HasImplicitTransaction) { _command.CommitImplicitTransaction(); } _command.ActiveReader = null; } if (_connection != null && IsCommandBehavior(CommandBehavior.CloseConnection)) { _connection.Close(); } _position = StartPosition; _command = null; _connection = null; _row = null; _schemaTable = null; _fields = null; } }