public void Clear() { CommandText.Clear(); ParameterCollection.Clear(); if (_reader != null) { _reader.Close(); _reader = null; } Transaction = null; }
public bool EndOfList(string replaceWith) { bool flag = false; string input = CommandText.ToString(); var match = TrailingCommaRegex.Match(input); if (match.Success) { CommandText.Clear(); CommandText.Append(input.Remove(input.Length - match.Groups["FullOperator"].Length, match.Groups["FullOperator"].Length)); CommandText.Append(replaceWith); CommandText.Append(match.Groups["LineSuffix"].Value); flag = true; } return(flag); }
public void EndQuery() { CommandText.Clear(); _prepareBindings.Clear(); _command.Parameters.Clear(); _command.Connection = null; if (Reader != null) { Reader.Dispose(); Reader = null; } if (_dbConnector != null) { _pool.ReturnDBC(_dbConnector); _dbConnector = null; } }
public bool EndOfWhere(string replaceWith) { bool flag = false; string input = CommandText.ToString(); Match match = TrailingWhereAndOrRegex.Match(input); if (match.Success) { CommandText.Clear(); CommandText.Append(input.Remove(input.Length - match.Groups["FullOperator"].Length, match.Groups["FullOperator"].Length)); if (match.Groups["Operator"].Value.Equals("where", StringComparison.InvariantCultureIgnoreCase)) { CommandText.Append(match.Groups["LinePrefix"].Value); } CommandText.Append(replaceWith); CommandText.Append(match.Groups["LineSuffix"].Value); flag = true; } return(flag); }
public void QueryNoReader(string query, params object[] args) { CommandText.Clear(); CommandText.AppendFormat(query, args); QueryNoReader(); }
public SqlDataReader Query(string query, params object[] args) { CommandText.Clear(); CommandText.AppendFormat(query, args); return(Query()); }
public void Dispose() { CommandText.Clear(); ParameterCollection.Clear(); Connection.Close(); }