Пример #1
0
 public long  Get(string seqName  )
 {
     int total = 1;
     DataHelper hp = new DataHelper(connString, providerName);
     DbParameter[] pars = new DbParameter[4];
     DbParameter startPar, endPar;
     pars[0] = DataHelper.CreateParameter(providerName, "SeqName", seqName);
     pars[1] = DataHelper.CreateParameter(providerName, "SeqNum", total);
     startPar = DataHelper.CreateParameter(providerName, "SeqStart", DbType.Int64, ParameterDirection.Output);
     endPar = DataHelper.CreateParameter(providerName, "SeqEnd", DbType.Int64, ParameterDirection.Output);
     pars[2] = startPar;
     pars[3] = endPar;
     hp.ExecuteNonQuery(getSeqSp, System.Data.CommandType.StoredProcedure, pars);
     long start = (long)startPar.Value;
     long end = (long)endPar.Value;
     //Log.Write(LogAction.Write, seqName + ":" + start + " " + end);
     if (end - start == total - 1)
         return  end;
     string msg = "多取" + seqName + "返回异常,返回数量和指定数量不合:total=" + total + " start=" + start + " end=" + end;
     Log.Error(msg);
     throw new DataException(msg);
 }
Пример #2
0
 public int AdapterSave(DataSet ds, string insertCmdText, string updateCmdText, string deleteCmdText, CommandType cmdType, params DbParameter[] parameters)
 {
     DataHelper hp = new DataHelper(_connString, _providerName);
     return  hp.AdapterSave(ds, insertCmdText, updateCmdText, deleteCmdText, cmdType, parameters); 
 }
Пример #3
0
 public bool SqlBulkInsertDataReader(string targetTable, IDataReader dr)
 {
     DataHelper hp = new DataHelper(_connString, _providerName);
     return  hp.SqlBulkInsertDataReader(targetTable, dr); 
 }
Пример #4
0
 public string ExecuteDataList(string cmdText, CommandType cmdType, params DbParameter[] parameters)
 {
     DataHelper hp = new DataHelper(_connString, _providerName);
     return hp.ExecuteDataList(cmdText, cmdType, parameters);
 }
Пример #5
0
 public int Fill(DataSet ds, string cmdText, CommandType cmdType, params DbParameter[] parameters)
 {
     DataHelper hp = new DataHelper(_connString, _providerName);
     return hp.Fill(ds, cmdText, cmdType, parameters); 
 }
Пример #6
0
 public DataSet ExecuteDataSet(string tableName, string cmdText, CommandType cmdType, params DbParameter[] parameters)
 {
     DataHelper hp = new DataHelper(_connString, _providerName);
     return hp.ExecuteDataSet(tableName, cmdText, cmdType, parameters);
 }
Пример #7
0
        public object ExecuteScalar(string cmdText, CommandType cmdType, params DbParameter[] parameters)
        {
            DataHelper hp = new DataHelper(_connString, _providerName);
            return hp.ExecuteScalar(cmdText, cmdType, parameters);

        }
Пример #8
0
 public int ExecuteNonQuery(string cmdText, CommandType cmdType, params DbParameter[] parameters)
 {
     DataHelper hp = new DataHelper(_connString, _providerName);
     int rtn = hp.ExecuteNonQuery(cmdText, cmdType, parameters);
     return rtn;
 }
Пример #9
0
 public bool SqlBulkInsertDataTable(string targetTable, DataTable dt, SqlBulkCopyColumnMapping[] mappings)
 {
     DataHelper hp = new DataHelper(_connString, _providerName);
     return hp.SqlBulkInsertDataTable(targetTable, dt, mappings);
 }
Пример #10
0
 public bool SqlBulkInsertDataTable(string targetTable, DataTable dt)
 {
     DataHelper hp = new DataHelper(_connString, _providerName);
     return  hp.SqlBulkInsertDataTable(targetTable, dt); 
 }