Ejemplo n.º 1
0
        public void Clear()
        {
            CommandText.Clear();
            ParameterCollection.Clear();

            if (_reader != null)
            {
                _reader.Close();
                _reader = null;
            }

            Transaction = null;
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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;
            }
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public void QueryNoReader(string query, params object[] args)
 {
     CommandText.Clear();
     CommandText.AppendFormat(query, args);
     QueryNoReader();
 }
Ejemplo n.º 6
0
 public SqlDataReader Query(string query, params object[] args)
 {
     CommandText.Clear();
     CommandText.AppendFormat(query, args);
     return(Query());
 }
Ejemplo n.º 7
0
 public void Dispose()
 {
     CommandText.Clear();
     ParameterCollection.Clear();
     Connection.Close();
 }