當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。