Example #1
0
 internal void Parse(Command cmd)
 {
     if (SqlText.Length > 0)
     {
         cmd.Text.Append(" where ").Append(SqlText.ToString());
         for(int i =0;i<Parameters.Count;i++)
         {
             Command.Parameter p= Parameters[i];
        
             cmd.AddParameter(p);
         }
     }
 }
Example #2
0
        public DataSet ExecuteDataSet(Command cmd)
        {
            IDbCommand _execmd = cmd.CreateCommand(Driver);
            OnInitCommand(_execmd);
            IDataAdapter da = Driver.DataAdapter(_execmd);
            DataSet ds = new DataSet();
            da.Fill(ds);

            return ds;
        }
Example #3
0
        public object ExecuteScalar(Command cmd)
        {

            IDbCommand _execmd = cmd.CreateCommand(Driver);
            OnInitCommand(_execmd);
            return _execmd.ExecuteScalar();
        }
Example #4
0
 public IDataReader ExecuteReader(Command cmd)
 {
     IDbCommand _execmd = cmd.CreateCommand(Driver);
     OnInitCommand(_execmd);
     
     return _execmd.ExecuteReader();
 }
Example #5
0
 public int ExecuteNonQuery(Command cmd)
 {
     IDbCommand _execmd = cmd.CreateCommand(Driver);
     OnInitCommand(_execmd);
     return _execmd.ExecuteNonQuery();
 }
Example #6
0
 /// <summary>
 /// 获取当前线程的命令对象
 /// </summary>
 /// <returns>Command</returns>
 public static Command GetThreadCommand()
 {
     if (mThreadCommand == null)
         mThreadCommand = new Command("");
     mThreadCommand.Clean();
     return mThreadCommand;
 }