當前位置: 首頁>>代碼示例>>C#>>正文


C# Data.DBCommandWrapper類代碼示例

本文整理匯總了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);
            }
        }
開發者ID:bnantz,項目名稱:NCS-V1-1,代碼行數:15,代碼來源:ParameterCache.cs

示例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();
        }
開發者ID:bnantz,項目名稱:NCS-V1-1,代碼行數:28,代碼來源:ParameterCache.cs

示例3: FillRolesDuty

		private DataSet FillRolesDuty(int getTeaNumber)
		{
			getRolseDutyCommand = "GetRolesDuty";
			dbCommandWrapper = dbRoles.GetStoredProcCommandWrapper(getRolseDutyCommand);
			dbCommandWrapper.AddInParameter("@getTeaNumber",DbType.Int32,getTeaNumber);
			return dbRoles.ExecuteDataSet(dbCommandWrapper);
		}
開發者ID:zesus19,項目名稱:c4.v2.T,代碼行數:7,代碼來源:RolesDataAccess.cs

示例4: CheckTeaDuty

		private void CheckTeaDuty()
		{
			checkTeaDutyCommand = "RecTeacherWorkingDaysPerWeek";
			dbCommandWrapper = dbPrepareForCheck.GetStoredProcCommandWrapper(checkTeaDutyCommand);
			dbCommandWrapper.CommandTimeout = 180;
			dbPrepareForCheck.ExecuteNonQuery(dbCommandWrapper);
		}
開發者ID:zesus19,項目名稱:c4.v2.T,代碼行數:7,代碼來源:PrepareForStuCheckInfoDataAccess.cs

示例5: SaveTeaAlternate

		private void SaveTeaAlternate()
		{
			saveAlternateCommand = "SaveAlternate";
			dbCommandWrapper = dbPrepareForCheck.GetStoredProcCommandWrapper(saveAlternateCommand);
			dbCommandWrapper.CommandTimeout = 180;
			dbPrepareForCheck.ExecuteNonQuery(dbCommandWrapper);
		}
開發者ID:zesus19,項目名稱:c4.v2.T,代碼行數:7,代碼來源:PrepareForStuCheckInfoDataAccess.cs

示例6: CheckAbsDoneYesterday

		private void CheckAbsDoneYesterday()
		{
			checkAbsDoneYesterdayCommand = "CheckAbsDoneYesterday";
			dbCommandWrapper = dbPrepareForCheck.GetStoredProcCommandWrapper(checkAbsDoneYesterdayCommand);
			dbCommandWrapper.CommandTimeout = 600;
			dbPrepareForCheck.ExecuteNonQuery(dbCommandWrapper);
		}
開發者ID:zesus19,項目名稱:c4.v2.T,代碼行數:7,代碼來源:PrepareForStuCheckInfoDataAccess.cs

示例7: FillAbsentStudent

		private void FillAbsentStudent()
		{
			fillAbsentStudentCommand = "FillAbsentStudent";
			dbCommandWrapper = dbPrepareForCheck.GetStoredProcCommandWrapper(fillAbsentStudentCommand);
			dbCommandWrapper.CommandTimeout = 180;
			dbPrepareForCheck.ExecuteNonQuery(dbCommandWrapper);
		}
開發者ID:zesus19,項目名稱:c4.v2.T,代碼行數:7,代碼來源:PrepareForStuCheckInfoDataAccess.cs

示例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);
		}
開發者ID:zesus19,項目名稱:c4.v2.T,代碼行數:8,代碼來源:StuInfoDataAccess.cs

示例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);
		}
開發者ID:zesus19,項目名稱:c4.v2.T,代碼行數:9,代碼來源:StuVisitInfoDataAccess.cs

示例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);
		}
開發者ID:zesus19,項目名稱:c4.v2.T,代碼行數:10,代碼來源:FinanInfoDataAccess.cs

示例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);
		}
開發者ID:zesus19,項目名稱:c4.v2.T,代碼行數:12,代碼來源:StuInfoDataAccess.cs

示例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;
		}	
開發者ID:zesus19,項目名稱:c4.v2.T,代碼行數:11,代碼來源:StuVisitInfoDataAccess.cs

示例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"));
		}
開發者ID:zesus19,項目名稱:c4.v2.T,代碼行數:11,代碼來源:RealtimeInfo_TeacherDataAccess.cs

示例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]);
		}
開發者ID:zesus19,項目名稱:c4.v2.T,代碼行數:11,代碼來源:RealtimeInfo_TeacherDataAccess.cs

示例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);
		}
開發者ID:zesus19,項目名稱:c4.v2.T,代碼行數:11,代碼來源:RealtimeInfoDataAccess.cs


注:本文中的Microsoft.Practices.EnterpriseLibrary.Data.DBCommandWrapper類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。