public void Execute(string AStatement, SQLParameters AParameters) { CheckConnectionValid(); using (SQLCommand LCommand = CreateCommand()) { LCommand.Statement = AStatement; LCommand.Parameters.AddRange(AParameters); LCommand.Execute(); } }
public void Execute(string statement, SQLParameters parameters) { CheckConnectionValid(); using (SQLCommand command = CreateCommand(false)) { command.Statement = statement; command.Parameters.AddRange(parameters); command.Execute(); } }
public void Close(SQLCursor ACursor) { SQLCommand LCommand = ACursor.Command; try { ACursor.Command.Close(ACursor); } finally { LCommand.Dispose(); } }
public void Close(SQLCursor cursor) { SQLCommand command = cursor.Command; try { cursor.Command.Close(cursor); } finally { command.Dispose(); } }
public SQLCommand CreateCommand(bool isCursor) { SQLCommand command = InternalCreateCommand(); if (_defaultCommandTimeout >= 0) { command.CommandTimeout = _defaultCommandTimeout; } if (isCursor) { command.UseParameters = _defaultUseParametersForCursors; } command.ShouldNormalizeWhitespace = _defaultShouldNormalizeWhitespace; return(command); }
internal void SetActiveCommand(SQLCommand ACommand) { if ((ACommand != null) && (FActiveCommand != null)) { throw new ConnectionException(ConnectionException.Codes.ConnectionBusy); } FActiveCommand = ACommand; if (FActiveCommand != null) { FState = SQLConnectionState.Executing; } else { FState = SQLConnectionState.Idle; } }
public SQLCursor Open(string AStatement, SQLParameters AParameters, SQLCursorType ACursorType, SQLIsolationLevel ACursorIsolationLevel, SQLCommandBehavior ABehavior) { CheckConnectionValid(); SQLCommand LCommand = CreateCommand(); try { LCommand.Statement = AStatement; LCommand.Parameters.AddRange(AParameters); LCommand.CommandBehavior = ABehavior; return(LCommand.Open(ACursorType, ACursorIsolationLevel)); } catch { LCommand.Dispose(); throw; } }
public SQLCursor Open(string statement, SQLParameters parameters, SQLCursorType cursorType, SQLIsolationLevel cursorIsolationLevel, SQLCommandBehavior behavior) { CheckConnectionValid(); SQLCommand command = CreateCommand(true); try { command.Statement = statement; command.Parameters.AddRange(parameters); command.CommandBehavior = behavior; return(command.Open(cursorType, cursorIsolationLevel)); } catch { command.Dispose(); throw; } }
internal void SetActiveCommand(SQLCommand command) { if ((command != null) && (_activeCommand != null) && !_supportsMARS) { throw new ConnectionException(ConnectionException.Codes.ConnectionBusy); } if ((_activeCommand != null) && _activeCommands.Contains(_activeCommand)) { _activeCommands.Remove(_activeCommand); } _activeCommand = command; if ((_activeCommand != null) && !_activeCommands.Contains(_activeCommand)) { _activeCommands.Add(_activeCommand); } if (_activeCommands.Count > 0) { _state = SQLConnectionState.Executing; } else { _state = SQLConnectionState.Idle; } }
protected SQLCursor(SQLCommand command) : base() { _command = command; _command.SetActiveCursor(this); }
protected SQLCursor(SQLCommand ACommand) : base() { FCommand = ACommand; FCommand.SetActiveCursor(this); }