本文整理汇总了C#中DataConnection.GetTable方法的典型用法代码示例。如果您正苦于以下问题:C# DataConnection.GetTable方法的具体用法?C# DataConnection.GetTable怎么用?C# DataConnection.GetTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataConnection
的用法示例。
在下文中一共展示了DataConnection.GetTable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Pref
public static string Pref(string prefName)
{
string command="SELECT ValueString FROM preference WHERE PrefName='"+POut.String(prefName)+"'";
DataConnection dcon=new DataConnection();
DataTable table=dcon.GetTable(command);
return table.Rows[0][0].ToString();
}
示例2: RetainedEarningsAuto
///<Summary>Gets sum of all income-expenses for all previous years. asOfDate could be any date</Summary>
public static float RetainedEarningsAuto(object asOfDateObj)
{
DateTime asOfDate;
if(asOfDateObj.GetType()==typeof(string)) {
asOfDate=PIn.Date(asOfDateObj.ToString());
}
else if(asOfDateObj.GetType()==typeof(DateTime)) {
asOfDate=(DateTime)asOfDateObj;
}
else {
return 0;
}
DateTime firstOfYear=new DateTime(asOfDate.Year,1,1);
string command="SELECT SUM(CreditAmt), SUM(DebitAmt), AcctType "
+"FROM journalentry,account "
+"WHERE journalentry.AccountNum=account.AccountNum "
+"AND DateDisplayed < "+POut.Date(firstOfYear)
+" GROUP BY AcctType";
DataConnection dcon=new DataConnection();
DataTable table=dcon.GetTable(command);
float retVal=0;
for(int i=0;i<table.Rows.Count;i++) {
if(table.Rows[i][2].ToString()=="3"//income
|| table.Rows[i][2].ToString()=="4")//expense
{
retVal+=PIn.Float(table.Rows[i][0].ToString());//add credit
retVal-=PIn.Float(table.Rows[i][1].ToString());//subtract debit
//if it's an expense, we are subtracting (income-expense), but the signs cancel.
}
}
return retVal;
}
示例3: MakeReadableDefNum
//private Hashtable hash;
///<summary>Constructor</summary>
public MakeReadableDefNum(){
//hash=new Hashtable();
string command="SELECT * FROM definition ORDER BY Category,ItemOrder";
DataConnection dcon=new DataConnection();
DataTable table=dcon.GetTable(command);
Defs.FillCache(table);
}