本文整理汇总了C#中Microsoft.Practices.EnterpriseLibrary.Data.DBCommandWrapper类的典型用法代码示例。如果您正苦于以下问题:C# DBCommandWrapper类的具体用法?C# DBCommandWrapper怎么用?C# DBCommandWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DBCommandWrapper类属于Microsoft.Practices.EnterpriseLibrary.Data命名空间,在下文中一共展示了DBCommandWrapper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddParametersFromCache
/// <summary>
/// <para>Adds parameters to a command using the cache</para>
/// </summary>
/// <param name="command">
/// <para>The command to add the parameters.</para>
/// </param>
protected virtual void AddParametersFromCache(DBCommandWrapper command)
{
IDataParameter[] parameters = this.cache.GetCachedParameterSet(command.Command);
foreach (IDataParameter p in parameters)
{
command.Command.Parameters.Add(p);
}
}
示例2: FillParameters
/// <summary>
/// <para>
/// Populates the parameter collection for a command wrapper from the cache
/// or performs a round-trip to the database to query the parameters
/// </para>
/// </summary>
/// <param name="command">
/// <para>The command to add the parameters.</para>
/// </param>
/// <param name="parameterToken">
/// <para>The token used to delimit parameters.</para>
/// </param>
public void FillParameters(DBCommandWrapper command, char parameterToken)
{
if (AlreadyCached(command))
{
AddParametersFromCache(command);
}
else
{
command.DiscoverParameters(parameterToken);
IDataParameter[] copyOfParameters = CreateParameterCopy(command);
this.cache.AddParameterSetToCache(command.Command, copyOfParameters);
}
command.AssignParameterValues();
}
示例3: FillRolesDuty
private DataSet FillRolesDuty(int getTeaNumber)
{
getRolseDutyCommand = "GetRolesDuty";
dbCommandWrapper = dbRoles.GetStoredProcCommandWrapper(getRolseDutyCommand);
dbCommandWrapper.AddInParameter("@getTeaNumber",DbType.Int32,getTeaNumber);
return dbRoles.ExecuteDataSet(dbCommandWrapper);
}
示例4: CheckTeaDuty
private void CheckTeaDuty()
{
checkTeaDutyCommand = "RecTeacherWorkingDaysPerWeek";
dbCommandWrapper = dbPrepareForCheck.GetStoredProcCommandWrapper(checkTeaDutyCommand);
dbCommandWrapper.CommandTimeout = 180;
dbPrepareForCheck.ExecuteNonQuery(dbCommandWrapper);
}
示例5: SaveTeaAlternate
private void SaveTeaAlternate()
{
saveAlternateCommand = "SaveAlternate";
dbCommandWrapper = dbPrepareForCheck.GetStoredProcCommandWrapper(saveAlternateCommand);
dbCommandWrapper.CommandTimeout = 180;
dbPrepareForCheck.ExecuteNonQuery(dbCommandWrapper);
}
示例6: CheckAbsDoneYesterday
private void CheckAbsDoneYesterday()
{
checkAbsDoneYesterdayCommand = "CheckAbsDoneYesterday";
dbCommandWrapper = dbPrepareForCheck.GetStoredProcCommandWrapper(checkAbsDoneYesterdayCommand);
dbCommandWrapper.CommandTimeout = 600;
dbPrepareForCheck.ExecuteNonQuery(dbCommandWrapper);
}
示例7: FillAbsentStudent
private void FillAbsentStudent()
{
fillAbsentStudentCommand = "FillAbsentStudent";
dbCommandWrapper = dbPrepareForCheck.GetStoredProcCommandWrapper(fillAbsentStudentCommand);
dbCommandWrapper.CommandTimeout = 180;
dbPrepareForCheck.ExecuteNonQuery(dbCommandWrapper);
}
示例8: FillGradeData
private DataSet FillGradeData(string gradeName,string gradeNumber)
{
getGradeInfoCommand = "GetGradeList";
dbCommandWrapper = dbAccess.GetStoredProcCommandWrapper(getGradeInfoCommand);
dbCommandWrapper.AddInParameter("@GradeName",DbType.String,gradeName);
dbCommandWrapper.AddInParameter("@GradeNumber",DbType.String,gradeNumber);
return dbAccess.ExecuteDataSet(dbCommandWrapper);
}
示例9: Fill2DaysAbs
private DataSet Fill2DaysAbs(string getGrade,string getClass,DateTime getDate)
{
get2DaysAbsCommand = "Get2DaysAbsence";
dbCommandWrapper = dbVisit.GetStoredProcCommandWrapper(get2DaysAbsCommand);
dbCommandWrapper.AddInParameter("@stuGrade",DbType.String,getGrade);
dbCommandWrapper.AddInParameter("@stuClass",DbType.String,getClass);
dbCommandWrapper.AddInParameter("@getDate",DbType.DateTime,getDate);
return dbVisit.ExecuteDataSet(dbCommandWrapper);
}
示例10: FillFinanStuInfo
private DataSet FillFinanStuInfo(string getGrade,string getClass,string getName,string getNumber)
{
getFinanStuInfoCommand = "GetFinanStuInfo";
dbCommandWrapper = dbContiAbs.GetStoredProcCommandWrapper(getFinanStuInfoCommand);
dbCommandWrapper.AddInParameter("@stuGrade",DbType.String,getGrade);
dbCommandWrapper.AddInParameter("@stuClass",DbType.String,getClass);
dbCommandWrapper.AddInParameter("@stuName",DbType.String,getName);
dbCommandWrapper.AddInParameter("@stuNumber",DbType.String,getNumber);
return dbContiAbs.ExecuteDataSet(dbCommandWrapper);
}
示例11: FillStuInfoData
//查询学生信息表,返回数据集
private DataSet FillStuInfoData(string stuGrade,string stuClass,
string stuName,string stuNumber)
{
getStuInfoCommand = "GetStudentInfo";
dbCommandWrapper = dbAccess.GetStoredProcCommandWrapper(getStuInfoCommand);
dbCommandWrapper.AddInParameter("@StuGrade",DbType.String,stuGrade);
dbCommandWrapper.AddInParameter("@StuClass",DbType.String,stuClass);
dbCommandWrapper.AddInParameter("@StuName",DbType.String,stuName);
dbCommandWrapper.AddInParameter("@StuNumber",DbType.String,stuNumber);
return dbAccess.ExecuteDataSet(dbCommandWrapper);
}
示例12: FillAbsentDaysInMonth
private DataSet FillAbsentDaysInMonth(int getNumber,DateTime getDate)
{
getAbsentDaysInMonthCommand = "GetAbsentDaysInMonth";
dbCommandWrapper = dbVisit.GetStoredProcCommandWrapper(getAbsentDaysInMonthCommand);
dbCommandWrapper.AddInParameter("@getStuNumber",DbType.Int16,getNumber);
dbCommandWrapper.AddInParameter("@getDate",DbType.DateTime,getDate);
dbCommandWrapper.AddOutParameter("getAbsSum",DbType.Int32,4);
DataSet dsAbsentDaysInMonth = dbVisit.ExecuteDataSet(dbCommandWrapper);
GetAbsSum = Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getAbsSum"));
return dsAbsentDaysInMonth;
}
示例13: FillTeaNumbers
private int FillTeaNumbers(string getWeekDay,string getDutyID,string getDept)
{
getTeaNumbersCommand = "GetTeaNumberInDuty";
dbCommandWrapper = dbRealtimeInfo.GetStoredProcCommandWrapper(getTeaNumbersCommand);
dbCommandWrapper.AddInParameter("@getDept",DbType.String,getDept);
dbCommandWrapper.AddInParameter("@getWeekDay",DbType.String,getWeekDay);
dbCommandWrapper.AddInParameter("@getDutyID",DbType.String,getDutyID);
dbCommandWrapper.AddOutParameter("@getTeaNumbers",DbType.Int32,4);
dbRealtimeInfo.ExecuteNonQuery(dbCommandWrapper);
return Convert.ToInt32(dbCommandWrapper.GetParameterValue("@getTeaNumbers"));
}
示例14: FillTeacherRealTimeInfoWithNoDuty
private void FillTeacherRealTimeInfoWithNoDuty(string dept,string getWeekDay, ref int total, ref int attend, ref int leave)
{
string getRealTimeInfoWithNoDuty = "GetTeacher_RealTimeInfo_WithNoDuty";
dbCommandWrapper = dbRealtimeInfo.GetStoredProcCommandWrapper(getRealTimeInfoWithNoDuty);
dbCommandWrapper.AddInParameter("@getDayOfWeek", DbType.String, getWeekDay);
dbCommandWrapper.AddInParameter("@getDept", DbType.String, dept);
DataSet dsInfo = dbRealtimeInfo.ExecuteDataSet(dbCommandWrapper);
total = Convert.ToInt32(dsInfo.Tables[0].Rows[0][0]);
attend = Convert.ToInt32(dsInfo.Tables[1].Rows[0][0]);
leave = Convert.ToInt32(dsInfo.Tables[2].Rows[0][0]);
}
示例15: FillRealtime
private DataSet FillRealtime(DateTime getDate,string getGrade,string getClass,int getState,int needSum)
{
getRealtimeInfoCommand = "GetRealTimeInfo";
dbCommandWrapper = dbRealtime.GetStoredProcCommandWrapper(getRealtimeInfoCommand);
dbCommandWrapper.AddInParameter("@getDate",DbType.String,getDate.Date.ToString("yyyy-MM-dd"));
dbCommandWrapper.AddInParameter("@getGrade",DbType.String,getGrade);
dbCommandWrapper.AddInParameter("@getClass",DbType.String,getClass);
dbCommandWrapper.AddInParameter("@getState",DbType.Int32,getState);
dbCommandWrapper.AddInParameter("@needSum",DbType.Int32,needSum);
return dbRealtime.ExecuteDataSet(dbCommandWrapper);
}