private void RecreateConnection() { if (Reader != null) { Reader.Close(); Reader.Dispose(); Reader = null; } if (ExecutableCommand != null) { ExecutableCommand.Dispose(); ExecutableCommand = null; } ExecutableCommand = Factory.CreateCommand(); ExecutableCommand.CommandText = _Command; ExecutableCommand.Connection = Connection; ExecutableCommand.CommandType = CommandType; if (Transaction != null) { ExecutableCommand.Transaction = Transaction; } }
public virtual void Dispose() { Close(); if (Connection != null) { Connection.Dispose(); Connection = null; } if (Transaction != null) { Transaction.Dispose(); Transaction = null; } if (ExecutableCommand != null) { ExecutableCommand.Dispose(); ExecutableCommand = null; } if (Reader != null) { Reader.Dispose(); Reader = null; } }