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


C# DAO.GetDataTable方法代码示例

本文整理汇总了C#中TPortalClass.DAO.GetDataTable方法的典型用法代码示例。如果您正苦于以下问题:C# DAO.GetDataTable方法的具体用法?C# DAO.GetDataTable怎么用?C# DAO.GetDataTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TPortalClass.DAO的用法示例。


在下文中一共展示了DAO.GetDataTable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetHits

 public DataTable GetHits()
 {
     String sql = "Select * from JpHits order by  hits_date desc";
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(sql);
     return dt;
 }
开发者ID:wjszxli,项目名称:xdjb,代码行数:7,代码来源:JpHits.cs

示例2: JpColumns

        public JpColumns(string cid)
        {
            string sql = " select * from JpColumns ";
            sql += " where cid = @cid ";

            DAO db = new DAO();

            SqlParameter[] sqlparam = {
                    db.MakeInParam("@cid",SqlDbType.VarChar,cid),
                };

            DataTable dt = db.GetDataTable(sql, sqlparam);

            if (dt.Rows.Count > 0)
            {
                this.cid = dt.Rows[0]["cid"].ToString();
                this.cname = dt.Rows[0]["cname"].ToString();
                this.tmp_col = dt.Rows[0]["tmp_col"].ToString();
                this.tmp_art = dt.Rows[0]["tmp_art"].ToString();
                this.online = dt.Rows[0]["online"].ToString();
                this.hotpublish = dt.Rows[0]["hotpublish"].ToString();
                this.pubtime = dt.Rows[0]["pubtime"].ToString();
                this.seotitle = dt.Rows[0]["seotitle"].ToString();
                this.seokeywords = dt.Rows[0]["seokeywords"].ToString();
                this.seodescription = dt.Rows[0]["seodescription"].ToString();
                this.pubhtmlpath = dt.Rows[0]["pubhtmlpath"].ToString();
                this.ifhotnews = dt.Rows[0]["ifhotnews"].ToString();
                this.csort = Int32.Parse(dt.Rows[0]["csort"].ToString());
                this.shtml = dt.Rows[0]["shtml"].ToString();
                this.rss = Int32.Parse(dt.Rows[0]["rss"].ToString());
                this.newpic = dt.Rows[0]["newpic"].ToString();
                this.newday = Int32.Parse(dt.Rows[0]["newday"].ToString());
            }
        }
开发者ID:wjszxli,项目名称:xdjb,代码行数:34,代码来源:JpColumns.cs

示例3: JpSite

 public JpSite()
 {
     String sql = "Select * from JpSite";
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(sql);
     if (dt.Rows.Count > 0)
     {
         SiteName = dt.Rows[0]["SiteName"].ToString();
         CompName = dt.Rows[0]["CompName"].ToString();
         host = dt.Rows[0]["host"].ToString();
         root = dt.Rows[0]["root"].ToString();
         tel = dt.Rows[0]["tel"].ToString();
         fax = dt.Rows[0]["fax"].ToString();
         adminemail = dt.Rows[0]["adminemail"].ToString();
         bah = dt.Rows[0]["bah"].ToString();
         seo_indextitle = dt.Rows[0]["seo_indextitle"].ToString();
         seo_indexkeyword = dt.Rows[0]["seo_indexkeyword"].ToString();
         seo_indexdescription = dt.Rows[0]["seo_indexdescription"].ToString();
         copyright = dt.Rows[0]["copyright"].ToString();
         homepage = dt.Rows[0]["homepage"].ToString();
         visitors = System.Int32.Parse(dt.Rows[0]["visitors"].ToString());
         dbname = dt.Rows[0]["dbname"].ToString();
         version = dt.Rows[0]["version"].ToString();
         nwyuming = dt.Rows[0]["nwyuming"].ToString();
         wwyuming = dt.Rows[0]["wwyuming"].ToString();
         lan_big5 = dt.Rows[0]["lan_big5"].ToString();
     }
 }
开发者ID:wjszxli,项目名称:xdjb,代码行数:28,代码来源:JpSite.cs

示例4: Getdocs

 public DataTable Getdocs()
 {
     String sql = " select * from HyQzwd  ";
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(sql);
     db.Close();
     return dt;
 }
开发者ID:wjszxli,项目名称:xdjb,代码行数:8,代码来源:HyQzwd.cs

示例5: getActive

 public DataTable getActive(int count)
 {
     string cmdStr = " Select top " + count + " * from hy_activity where hy_ifsh='2'  and hy_starttime <=getdate() and hy_endtime >=getdate() order by hy_addtime desc , hy_sort desc ";
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(cmdStr);
     db.Close();
     db.Dispose();
     return dt;
 }
开发者ID:wjszxli,项目名称:xdjb,代码行数:9,代码来源:JpActivity.cs

示例6: getBetterGoods

 /// <summary>
 /// ��ȡ�̳Ƿ����ĺû�
 /// </summary>
 /// <param name="count">��ȡ����������</param>
 /// <returns></returns>
 public DataTable getBetterGoods(int count)
 {
     String sqlSelect = " select top " + count + " * from hy_goods where (hy_cid = '006001001' or hy_cid='006002001' or  hy_cid='006003001'  or  hy_cid='006004001') and hy_ifsh='2' order by hy_sort ";
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(sqlSelect);
     db.Close();
     db.Dispose();
     return dt;
 }
开发者ID:wjszxli,项目名称:xdjb,代码行数:14,代码来源:JpGoods.cs

示例7: Getdocbyid

 //�����ĵ�ID�õ���¼
 public DataTable Getdocbyid(string id)
 {
     String sql = " select * from HyQzwd where [email protected] ";
     DAO db = new DAO();
     SqlParameter[] sqlparam = {
             db.MakeInParam("@id",SqlDbType.Int,System.Int32.Parse(id)),
         };
     DataTable dt = db.GetDataTable(sql, sqlparam);
     db.Close();
     return dt;
 }
开发者ID:wjszxli,项目名称:xdjb,代码行数:12,代码来源:HyQzwd.cs

示例8: Getdocbyid

 //获取指定信息
 public DataTable Getdocbyid(Int32 id)
 {
     String sql = " select * from hy_news  ";
     sql += " where id = @id";
     DAO db = new DAO();
     SqlParameter[] sqlparam = {
             db.MakeInParam("@id",SqlDbType.Int,id),
         };
     DataTable dt = db.GetDataTable(sql, sqlparam);
     db.Close();
     return dt;
 }
开发者ID:wjszxli,项目名称:xdjb,代码行数:13,代码来源:JpNewsBroke.cs

示例9: Getdocs

 //获取指定信息
 public DataTable Getdocs(String orderby)
 {
     String sql = " select * from hy_news ";
     sql += " @orderby ";
     DAO db = new DAO();
     SqlParameter[] sqlparam = {
             db.MakeInParam("@orderby",SqlDbType.VarChar,orderby),
         };
     DataTable dt = db.GetDataTable(sql, sqlparam);
     db.Close();
     return dt;
 }
开发者ID:wjszxli,项目名称:xdjb,代码行数:13,代码来源:JpNewsBroke.cs

示例10: GetNewsbyaid

 //��ȡָ����Ϣ
 public DataTable GetNewsbyaid(Int32 aid)
 {
     String sql = " select * from JpNews  ";
     sql += " where aid = @aid";
     DAO db = new DAO();
     SqlParameter[] sqlparam = {
             db.MakeInParam("@aid",SqlDbType.Int,aid),
         };
     DataTable dt = db.GetDataTable(sql, sqlparam);
     db.Close();
     return dt;
 }
开发者ID:wjszxli,项目名称:xdjb,代码行数:13,代码来源:JpNews.cs

示例11: GetData

 public DataTable GetData(string strWhere)
 {
     String sql = " select * from hy_favorite where 1=1  ";
     if (strWhere != "")
     {
         sql += strWhere;
     }
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(sql);
     db.Close();
     return dt;
 }
开发者ID:wjszxli,项目名称:xdjb,代码行数:12,代码来源:JpFavorite.cs

示例12: GetCodesByTel

        /// <summary>
        /// 根据手机号查询最新一条验证码
        /// </summary>
        /// <param name="hy_tel"></param>
        /// <returns></returns>
        public DataTable GetCodesByTel(string hy_tel)
        {
            String sql = " select top 1 * from hy_verifycode where [email protected]_tel  ";
            sql += " order by hy_addtime desc";

            DAO db = new DAO();
            SqlParameter[] sqlparam = {
                    db.MakeInParam("@hy_tel",SqlDbType.VarChar,hy_tel),
                };
            DataTable dt = db.GetDataTable(sql, sqlparam);
            db.Close();
            return dt;
        }
开发者ID:wjszxli,项目名称:xdjb,代码行数:18,代码来源:JpVerifyCode.cs

示例13: Getdocbyid

 public DataTable Getdocbyid(string id)
 {
     string sql = " select * from hy_fileatt where [email protected] ";
     DAO db = new DAO();
     SqlParameter[] sqlparam = new SqlParameter[]
     {
         db.MakeInParam("@id", SqlDbType.VarChar, id)
     };
     DataTable dt = db.GetDataTable(sql, sqlparam);
     db.Close();
     db.Dispose();
     return dt;
 }
开发者ID:wjszxli,项目名称:xdjb,代码行数:13,代码来源:HyFileatt.cs

示例14: JpPubHtml

 public JpPubHtml()
 {
     String sql = "Select * from JpPubHtml";
     DAO db = new DAO();
     DataTable dt = db.GetDataTable(sql);
     if (dt.Rows.Count > 0)
     {
         id = dt.Rows[0]["id"].ToString();
         pages = dt.Rows[0]["pages"].ToString();
         days = dt.Rows[0]["days"].ToString();
         status = dt.Rows[0]["status"].ToString();
     }
 }
开发者ID:wjszxli,项目名称:xdjb,代码行数:13,代码来源:JpPubHtml.cs

示例15: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Request.QueryString["aid"] != null)
        {
            aid = this.Request.QueryString["aid"].ToString();
        }
        if (this.Request.QueryString["cid"] != null)
        {
            cid = this.Request.QueryString["cid"].ToString();
        }
        this.txtcid.Value = cid;
        this.txtaid.Value = aid;
        StringBuilder stringBuilder = new StringBuilder();
        DAO db = new DAO();
        //获得当前栏目名称
        string sqlSelect = " select cid,cname from JpColumns  where cid ='" + cid + "'  ";
        DataTable dt = db.GetDataTable(sqlSelect);
        if (dt.Rows.Count > 0)
        {
            this.lb_type.Text = dt.Rows[0]["cname"].ToString();
        }
        stringBuilder.Remove(0, stringBuilder.Length);
        dt.Clear();

        //获得当前文章内容
        sqlSelect = " select  * from JpArticle  where aid ='" + aid + "'  ";
        dt = db.GetDataTable(sqlSelect);
        if (dt.Rows.Count > 0)
        {
            this.lb_time.Text = Convert.ToDateTime(dt.Rows[0]["crtime"].ToString()).ToString("yyyy-MM-dd HH:mm");
            this.lb_title.Text = dt.Rows[0]["title"].ToString();
            imgPath = dt.Rows[0]["indexdisplaypicpath"].ToString();
            this.lb_article.Text = dt.Rows[0]["ht_content"].ToString();
        }
        stringBuilder.Remove(0, stringBuilder.Length);
        dt.Clear();
    }
开发者ID:wjszxli,项目名称:xdjb,代码行数:37,代码来源:art_audit.aspx.cs


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