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


C# DataConnection.GetTable方法代码示例

本文整理汇总了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();
 }
开发者ID:nampn,项目名称:ODental,代码行数:7,代码来源:GetData.cs

示例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;
 }
开发者ID:nampn,项目名称:ODental,代码行数:33,代码来源:GetData.cs

示例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);
		}
开发者ID:romeroyonatan,项目名称:opendental,代码行数:11,代码来源:MakeReadableDefNum.cs


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