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); }
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); }
public bool SqlBulkInsertDataReader(string targetTable, IDataReader dr) { DataHelper hp = new DataHelper(_connString, _providerName); return hp.SqlBulkInsertDataReader(targetTable, dr); }
public string ExecuteDataList(string cmdText, CommandType cmdType, params DbParameter[] parameters) { DataHelper hp = new DataHelper(_connString, _providerName); return hp.ExecuteDataList(cmdText, cmdType, parameters); }
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); }
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); }
public object ExecuteScalar(string cmdText, CommandType cmdType, params DbParameter[] parameters) { DataHelper hp = new DataHelper(_connString, _providerName); return hp.ExecuteScalar(cmdText, cmdType, parameters); }
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; }
public bool SqlBulkInsertDataTable(string targetTable, DataTable dt, SqlBulkCopyColumnMapping[] mappings) { DataHelper hp = new DataHelper(_connString, _providerName); return hp.SqlBulkInsertDataTable(targetTable, dt, mappings); }
public bool SqlBulkInsertDataTable(string targetTable, DataTable dt) { DataHelper hp = new DataHelper(_connString, _providerName); return hp.SqlBulkInsertDataTable(targetTable, dt); }