Exemple #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);
         }
     }
 }
        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;
        }
        public object ExecuteScalar(Command cmd)
        {

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