public override void Prepare() { if (this.Statement != null) { this.Statement.Dispose(); } this.Statement = new UtlStatement(this, this._commandText, true); }
private void FetchResult() { if (((this._command.Parameters.Count != 0) || (this._command.CommandType == CommandType.StoredProcedure)) && (this._command.Statement == null)) { this._command.Prepare(); } if (this._command.Statement != null) { this._resultIn = this._command.Statement.Execute(this._command.Parameters, this._command.MaxRows, this._command.FetchSize, false); this._generatedResult = this._command.Statement.GeneratedResult; this._resultSets = this._command.Statement.ChainedResultSets; } else { using (UtlStatement statement = new UtlStatement(this._command, this._command.CommandText, false)) { if ((this._commandBehavior & CommandBehavior.SchemaOnly) != CommandBehavior.Default) { try { Result result = statement.Execute(1, 1, false); if (result.IsError()) { throw new Exception(); } this._resultIn = result; } catch (Exception) { this._resultIn = statement.PrepareStatement(); } } else { this._resultIn = statement.Execute(this._command.MaxRows, this._command.FetchSize, false); } this._generatedResult = statement.GeneratedResult; this._resultSets = statement.ChainedResultSets; } if (this._resultIn != null) { this.ClearResultStructures(this._resultIn); if (this._generatedResult != null) { this.ClearResultStructures(this._generatedResult); } if (this._resultSets != null) { foreach (Result result2 in this._resultSets) { this.ClearResultStructures(result2); } } } } }
public void ClearCommands() { if (this._activeReader != null) { UtlDataReader target = null; try { target = this._activeReader.Target as UtlDataReader; } catch (InvalidOperationException) { } if (target != null) { target.Close(); } this._activeReader = null; } if (this.Statement != null) { this.Statement.Dispose(); } this.Statement = null; }