本文整理汇总了C#中FrontFlag.SQL.ExecDataTable方法的典型用法代码示例。如果您正苦于以下问题:C# SQL.ExecDataTable方法的具体用法?C# SQL.ExecDataTable怎么用?C# SQL.ExecDataTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrontFlag.SQL
的用法示例。
在下文中一共展示了SQL.ExecDataTable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DataTable
public DataTable Get统计( string strWhere )
{
int nYNow = DateTime.Now.Year;
int nY80 = nYNow - 80;
int nY90 = nYNow - 90;
int nY100 = nYNow - 100;
string str80 = String.Format("{0}-01-01", nY80);
string str90 = String.Format( "{0}-01-01", nY90 );
string str100 = String.Format( "{0}-01-01", nY100 );
DataTable dt = new DataTable();
SQL Sql = new SQL( DBParam.Sql.Connect );
if ( strWhere.Trim() != "" )
strWhere = " Where " + strWhere;
string strSql = String.Format( @"select 街道,
SUM( CASE WHEN 出生日期 >= '{0}' and 出生日期 < '{1}' THEN 1 ELSE 0 END) as 年龄段80,
SUM( CASE WHEN 出生日期 >= '{1}' and 出生日期 < '{2}' THEN 1 ELSE 0 END) as 年龄段90,
SUM( CASE WHEN 出生日期 >= '{2}' THEN 1 ELSE 0 END) as 年龄段100
from {3} {4} group by 街道 ",
str80, str90, str100,
DB.Tab.老龄办.发放老龄津贴.TAB, strWhere );
dt = Sql.ExecDataTable( strSql );
Sql.Close();
return dt;
}
示例2: GetPage
//Get one Page data from all
public DataTable GetPage(int nPageNo, string strWhere)
{
SQL Sql = new SQL(FF.TD.Def.ConnectStr);
DataTable dt = new DataTable();
string strSql = SQL.GetPageSql(Tab.TEST_LOG.TAB, nPageNo, FrontFlag.Test.DEF.PageSize, Tab.TEST_LOG.ID, strWhere);
dt = Sql.ExecDataTable(strSql);
Sql.Close();
return dt;
}
示例3: GetPage
//Get one Page data from all
public DataTable GetPage( int nPageNo, string strWhere )
{
SQL Sql = new SQL( DBParam.Sql.Connect );
DataTable dt = new DataTable();
string strSql = SQL.GetPageSql2005( DB.Tab.优抚科.优抚对象.铀矿开采军队退役人员员子女役人员.基本信息.TAB, nPageNo, CONST.PageSize, DB.Tab.优抚科.优抚对象.铀矿开采军队退役人员员子女役人员.基本信息.ID, strWhere, false );
dt = Sql.ExecDataTable( strSql );
Sql.Close();
return dt;
}
示例4: GetPage
//Get one Page data from all
public DataTable GetPage( int nPageNo, string strWhere )
{
SQL Sql = new SQL( DBParam.Sql.Connect );
DataTable dt = new DataTable();
string strSql = SQL.GetPageSql2005( DB.Tab.事务科.低收入居民.TAB, nPageNo, CONST.PageSize, DB.Tab.事务科.低收入居民.ID, strWhere, false );
dt = Sql.ExecDataTable( strSql );
Sql.Close();
return dt;
}
示例5: GetCount
public DataTable GetCount( string strWhere )
{
DataTable dt = new DataTable();
SQL Sql = new SQL ( DBParam.Sql.Connect );
if (strWhere.Trim() != "")
strWhere = " Where " + strWhere;
string strSql = String.Format("select Count(*) from {0} {1} ", DB.Tab.基层科.社区服务信息管理_社区公益服务.TAB, strWhere);
dt = Sql.ExecDataTable(strSql);
Sql.Close();
return dt;
}
示例6: GetWhere
public DataTable GetWhere( string strWhere )
{
DataTable dt = new DataTable();
SQL Sql = new SQL( DBParam.Sql.Connect );
if ( strWhere.Trim() != "" )
strWhere = " Where " + strWhere;
string strSql = String.Format( "select * from {0} {1} order by ID desc", DB.Tab.事务科.低收入居民.TAB, strWhere );
dt = Sql.ExecDataTable( strSql );
Sql.Close();
return dt;
}
示例7: GetWhere
public DataTable GetWhere(string strWhere)
{
DataTable dt = new DataTable();
SQL Sql = new SQL(FF.TD.Def.ConnectStr);
if (strWhere.Trim() != "")
strWhere = " Where " + strWhere;
string strSql = String.Format("select * from {0} {1} order by ID desc", Tab.TEST_LOG.TAB, strWhere);
dt = Sql.ExecDataTable(strSql);
Sql.Close();
return dt;
}
示例8: GetPahtID
/// <summary>
/// 查找指定Type的ID.
/// </summary>
/// <param name="strName"></param>
/// <param name="strParenID"></param>
/// <returns></returns>
string GetPahtID( string strName, string strParenID )
{
SQL Sql = new SQL( CONNECT.SqlConnect );
string strRet = "";
string strSql = String.Format( "select {0} from {1} where {2}='{3}' and {4}='{5}' ", Tab.ID, Tab.TAB, Tab.Name, strName, Tab.ParentID, strParenID );
DataTable dt = Sql.ExecDataTable( strSql );
if( SQL.IsValid( ref dt ) )
{
strRet = dt.Rows[0][Tab.ID].ToString().Trim();
}
Sql.Close();
return strRet;
}
示例9: GetStru_ByID
/// <summary>
///
/// </summary>
/// <param name="strID"></param>
/// <returns></returns>
DIC_STRU GetStru_ByID( string strID )
{
SQL Sql = new SQL( CONNECT.SqlConnect );
string strRet = "";
string strSql = String.Format( "select * from {1} where {2}='{3}' ", Tab.ID, Tab.TAB, Tab.ID, strID );
DataTable dt = Sql.ExecDataTable( strSql );
Sql.Close();
if( !SQL.IsValid( ref dt ) )
return null;
DIC_STRU stru = new DIC_STRU();
DataRow dr = dt.Rows[0];
stru.Dr2Stru( dr );
return stru;
}
示例10: DataTable
public DataTable Get统计( string strWhere )
{
DataTable dt = new DataTable();
SQL Sql = new SQL( DBParam.Sql.Connect );
if ( strWhere.Trim() != "" )
strWhere = " Where " + strWhere;
string strSql = String.Format( @"select 街道,
SUM( CASE WHEN 优待证类别 = '黄证' THEN 1 ELSE 0 END) as 黄证,
SUM( CASE WHEN 优待证类别 = '蓝证' THEN 1 ELSE 0 END) as 蓝证,
SUM( CASE WHEN 优待证类别 = '免费乘车证' THEN 1 ELSE 0 END) as 免费乘车证,
Count(*) as 合计
from {0} {1} group by 街道 ",
DB.Tab.老龄办.敬老优待证.TAB, strWhere );
dt = Sql.ExecDataTable( strSql );
Sql.Close();
return dt;
}
示例11: GetWhere
public DataTable GetWhere( string strWhere )
{
DataTable dt = new DataTable();
FrontFlag.SQL sql = new SQL( CONNECT.SqlConnect );
if( strWhere.Trim() != "" )
strWhere = " Where " + strWhere;
string strSql = String.Format( "select * from {0} {1} order by ID desc", Tab.TAB, strWhere );
dt = sql.ExecDataTable( strSql );
sql.Close();
return dt;
}
示例12: GetAllChild
/// <summary>
/// 获取父路径下的所有子参数。
/// </summary>
/// <param name="strParenID"></param>
/// <returns></returns>
public List<DIC_STRU> GetAllChild( string strParenID )
{
SQL Sql = new SQL( CONNECT.SqlConnect );
List<DIC_STRU> list = new List<DIC_STRU>();
string strSql = String.Format( "select * from {0} where {1}='{2}' order by {3} ", Tab.TAB, Tab.ParentID, strParenID, Tab.OrderNo );
DataTable dt = Sql.ExecDataTable( strSql );
list = DIC_STRU.Dt2List( ref dt );
Sql.Close();
return list;
}
示例13: GetSum
public DataTable GetSum( string strFld, string strWhere )
{
DataTable dt = new DataTable();
SQL Sql = new SQL( DBParam.Sql.Connect );
if ( strWhere.Trim() != "" )
strWhere = " Where " + strWhere;
string strSql = String.Format( "select Sum({2}) from {0} {1} ", DB.Tab.老龄办.敬老优待证统计.TAB, strWhere, strFld );
dt = Sql.ExecDataTable( strSql );
Sql.Close();
return dt;
}
示例14: GetChildMaxNo
/// <summary>
/// 查找所有子项中最大的序号。
/// </summary>
/// <param name="strParenID"></param>
/// <returns></returns>
public int GetChildMaxNo( string strParenID )
{
SQL Sql = new SQL( CONNECT.SqlConnect );
List<DIC_STRU> list = new List<DIC_STRU>();
string strSql = String.Format( "select * from {0} where {1}='{2}' order by {3} desc ", Tab.TAB, Tab.ParentID, strParenID, Tab.OrderNo );
DataTable dt = Sql.ExecDataTable( strSql );
list = DIC_STRU.Dt2List( ref dt );
Sql.Close();
if( list == null || list.Count <= 0 )
return 0;
int nNo = FF.Fun.MyConvert.Str2Int( list[0].OrderNo );
return nNo;
}
示例15: GetCount
public DataTable GetCount( string strWhere )
{
DataTable dt = new DataTable();
SQL Sql = new SQL( DBParam.Sql.Connect );
if ( strWhere.Trim() != "" )
strWhere = " Where " + strWhere;
string strSql = String.Format( "select Count(*) from {0} {1} ", DB.Tab.优抚科.优抚对象.铀矿开采军队退役人员.生活费来源.TAB, strWhere );
dt = Sql.ExecDataTable( strSql );
Sql.Close();
return dt;
}