当前位置: 首页>>代码示例>>C#>>正文


C# DbManager.ExecuteReader方法代码示例

本文整理汇总了C#中BLToolkit.Data.DbManager.ExecuteReader方法的典型用法代码示例。如果您正苦于以下问题:C# DbManager.ExecuteReader方法的具体用法?C# DbManager.ExecuteReader怎么用?C# DbManager.ExecuteReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BLToolkit.Data.DbManager的用法示例。


在下文中一共展示了DbManager.ExecuteReader方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HasRecord

 public bool HasRecord(long CustNo, DateTime PeriodDate)
 {
     DbManager db = new DbManager("IRMSConnectionString");
     bool bResult = false;
     db.SelectCommand.CommandText = string.Format(@"select top 1 balance_qty, balance_amt, balance_cost
             from rptstockcard_new
             where dateto='{0}' and custno={1}
             order by id desc",PeriodDate.ToShortDateString(),CustNo);
     using (IDataReader dbReader = db.ExecuteReader())
     {
         bResult = dbReader.Read();
         dbReader.Close();
     }
     return bResult;
 }
开发者ID:DennisPitallano,项目名称:IRMS-ACCOUNTING,代码行数:15,代码来源:StockCardReportManager.cs

示例2: Test

		public void Test()
		{
			using (DbManager db = new DbManager())
			{
				db.SetCommand("SELECT * FROM Person");

				using (IDataReader rd = db./*[a]*/ExecuteReader/*[/a]*/())
				{
					while (rd.Read())
					{
						// ...
					}
				}
			}
		}
开发者ID:MajidSafari,项目名称:bltoolkit,代码行数:15,代码来源:ExecuteReader.cs

示例3: FindPayableListByCustomerCode

        public bool FindPayableListByCustomerCode(string CustomerCode)
        {
            bool bResult = false;

            using (DbManager db = new DbManager())
            {
                try
                {
                    db.Command.CommandText = string.Format(@"select * from CUSTOMER_PAYABLE_TBL
            where CUSTCODE = '{0}'", CustomerCode);

                    using (IDataReader dbReader = (IDataReader)db.ExecuteReader())
                    {
                        CustomerPayableClass commpayable;
                        payableList.Clear();
                        while (dbReader.Read())
                        {
                            commpayable = new CustomerPayableClass();
                            commpayable.CustomerCode = CustomerCode;
                            commpayable.PayableCode = dbReader.GetString(dbReader.GetOrdinal("PAYABLE_CODE"));
                            commpayable.PayableAmount = (float)Convert.ToDecimal(dbReader.GetValue(dbReader.GetOrdinal("PAYABLE_AMOUNT")));

                            payableList.Add(commpayable);
                            bResult = true;
                        }
                        dbReader.Close();
                    }
                }
                catch (Exception except)
                {
                    throw new Exception("Error in retrieving payable obligation!");
                }
            }
            return bResult;
        }
开发者ID:DennisPitallano,项目名称:IRMS-MARKETING,代码行数:35,代码来源:CustomerInfo.cs

示例4: FindCommissionListByCustomerCode

        public bool FindCommissionListByCustomerCode(string CustomerCode)
        {
            bool bResult = false;

            using (DbManager db = new DbManager())
            {
                try
                {
                    db.Command.CommandText = string.Format(@"select * from CUSTOMER_COMMISSION_TBL
            where CUSTCODE = '{0}'",CustomerCode);

                    using (IDataReader dbReader = (IDataReader)db.ExecuteReader())
                    {
                        CustomerCommissionRate commrate;
                        commList.Clear();
                        while (dbReader.Read())
                        {
                            commrate = new CustomerCommissionRate();
                            commrate.CustomerCode = CustomerCode;
                            commrate.FieldType = dbReader.GetString(dbReader.GetOrdinal("FIELD_TYPE"));
                            commrate.FieldValue = (float)Convert.ToDecimal(dbReader.GetValue(dbReader.GetOrdinal("FIELD_VALUE")));
                            commrate.SalesType = dbReader.GetString(dbReader.GetOrdinal("SALES_TYPE"));

                            commList.Add(commrate);
                            bResult = true;
                        }
                        dbReader.Close();
                    }
                }
                catch (Exception except)
                {
                    throw new Exception("Error in retrieving commission rates!");
                }
            }
            return bResult;
        }
开发者ID:DennisPitallano,项目名称:IRMS-MARKETING,代码行数:36,代码来源:CustomerInfo.cs


注:本文中的BLToolkit.Data.DbManager.ExecuteReader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。