本文整理汇总了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;
}
示例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())
{
// ...
}
}
}
}
示例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;
}
示例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;
}