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


C# SQL.ExecDataTable方法代码示例

本文整理汇总了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;
        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:32,代码来源:老龄津贴统计2.cs

示例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;
        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:12,代码来源:Test_Log.cs

示例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;
        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:12,代码来源:基本信息.cs

示例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;
        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:12,代码来源:低收入居民.cs

示例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;
        }
开发者ID:cheng521yun,项目名称:FTMZ,代码行数:16,代码来源:社区服务信息管理_社区公益服务.cs

示例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;
        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:16,代码来源:低收入居民.cs

示例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;

        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:17,代码来源:Test_Log.cs

示例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;
        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:25,代码来源:Dictionary.cs

示例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;
        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:26,代码来源:Dictionary.cs

示例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;
        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:22,代码来源:敬老优待证统计2.cs

示例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;

        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:17,代码来源:Dictionary.cs

示例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;
        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:20,代码来源:Dictionary.cs

示例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;
        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:16,代码来源:敬老优待证统计.cs

示例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;
        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:24,代码来源:Dictionary.cs

示例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;
        }
开发者ID:cheng521yun,项目名称:https---github.com-frontflag-FTMZ_CY,代码行数:16,代码来源:生活费来源.cs


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