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


C# SQLHelper.Get_DataTable方法代码示例

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


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

示例1: btnRun_Click

 protected void btnRun_Click(object sender, EventArgs e)
 {
     string sql = tbxSql.Text.Trim().ToUpper();
     SQLHelper db = new SQLHelper();
     db.sql = sql;
     if (sql.Contains("SELECT "))
     {
         DataTable dt = db.Get_DataTable();
         gv.DataSource = dt;
         gv.DataBind();
         lblMsg.Text = "执行完成,查询结果如下:";
     }
     else
     {
         string result = db.ExecSql();
         if (result == "1")
         {
             lblMsg.Text = "执行完成";
         }
         else
         {
             lblMsg.Text = "执行失败," + result;
         }
     }
 }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:25,代码来源:execSql.aspx.cs

示例2: bindFunctionList

        protected void bindFunctionList()
        {
            functionList.Items.Clear();
            //for (int i = 1; i <= 35; i++)
            //{
            //    ListItem li = new ListItem();
            //    string img = "0" + i.ToString() + ".jpg";
            //    int len = img.Length;
            //    img = img.Substring(len - 6, 6);
            //    li.Value = img;
            //    li.Text = "<img src='../images/function_icon/" + img + "' />";
            //    functionList.Items.Add(li);
            //}

            SQLHelper db = new SQLHelper();
            db.sql = "SELECT NewsId,Title,Description,pic FROM " + com.tablePrefix + "News WHERE lbid=64";
            DataTable dt = db.Get_DataTable();
            functionList.DataSource = dt;
            foreach (DataRow dr in dt.Rows)
            {
                ListItem li = new ListItem();
                li.Value = dr["NewsId"].ToString();
                li.Text = "<img src='" + dr["pic"].ToString() + "' title='" + dr["Description"].ToString() + "' />";
                functionList.Items.Add(li);
            }
        }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:26,代码来源:ProAdd.aspx.cs

示例3: AdminInfo

 public static DataTable AdminInfo(int id)
 {
     string sql = "SELECT * FROM " + com.tablePrefix + "Admin WHERE id=" + id.ToString() + "";
     SQLHelper db = new SQLHelper();
     db.sql = sql;
     return db.Get_DataTable();
 }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:7,代码来源:clsAdmin.cs

示例4: bindProPlb

 protected void bindProPlb()
 {
     SQLHelper db = new SQLHelper();
     db.sql = "SELECT lbid,lbname FROM " + com.tablePrefix + "lb WHERE parentid=4 Order By OrderId";
     DataTable dt = db.Get_DataTable();
     rptProLbParent.DataSource = dt;
     rptProLbParent.DataBind();
 }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:8,代码来源:LeftMenu.aspx.cs

示例5: bindProvince

 protected void bindProvince()
 {
     SQLHelper db = new SQLHelper();
     db.sql = "SELECT id,name FROM " + com.tablePrefix + "Province ORDER BY OrderID";
     DataTable dt = db.Get_DataTable();
     ddlProvince.DataSource = dt;
     ddlProvince.DataValueField = "id";
     ddlProvince.DataTextField = "name";
     ddlProvince.DataBind();
 }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:10,代码来源:NetworkAdd.aspx.cs

示例6: bindLbList

 protected void bindLbList()
 {
     pid = hPid.Value;
     SQLHelper db = new SQLHelper();
     db.sql = "SELECT lbid,lbname FROM " + com.tablePrefix + "lb WHERE parentid=" + pid + " Order by orderid";
     DataTable dt = db.Get_DataTable();
     lbList.DataSource = dt.DefaultView;
     lbList.DataTextField = "lbname";
     lbList.DataValueField = "lbid";
     lbList.DataBind();
 }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:11,代码来源:ProAdd.aspx.cs

示例7: bindGv

        public void bindGv()
        {
            lbid = hlbid.Value;
            string sql = @"SELECT * FROM " + com.tablePrefix + "jiameng  ORDER BY AddTime DESC";
            SQLHelper db = new SQLHelper();
            db.sql = sql;
            DataTable dt = db.Get_DataTable();

            GV.DataSource = dt.DefaultView;
            GV.DataBind();
        }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:11,代码来源:jiameng.aspx.cs

示例8: bindDDlLbid

 protected void bindDDlLbid()
 {
     string sql = "SELECT lbid,lbname FROM " + com.tablePrefix + "lb WHERE parentid=1";
     SQLHelper db = new SQLHelper();
     db.sql = sql;
     DataTable dt = db.Get_DataTable();
     ddlLbid.DataSource = dt;
     ddlLbid.DataTextField = "lbname";
     ddlLbid.DataValueField = "lbid";
     ddlLbid.DataBind();
 }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:11,代码来源:NewsAdd.aspx.cs

示例9: emailExists

 public bool emailExists(string email)
 {
     SQLHelper db = new SQLHelper();
     db.sql = "SELECT * FROM " + com.tablePrefix + "Members WHERE email='" + email + "'";
     DataTable dt = db.Get_DataTable();
     if (dt.Rows.Count > 0)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:14,代码来源:clsMember.cs

示例10: bindGv

        public void bindGv()
        {
            lbid = hlbid.Value;
            string sql = @"SELECT *
            FROM "[email protected]"News
            WHERE lbid=" + lbid;
            sql += " ORDER BY isTop DESC,IsIndex DESC,AddTime DESC";
            SQLHelper db = new SQLHelper();
            db.sql = sql;
            DataTable dt = db.Get_DataTable();

            GV.DataSource = dt.DefaultView;
            GV.DataBind();
        }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:14,代码来源:news.aspx.cs

示例11: exists

 public bool exists(string uname)
 {
     SQLHelper db = new SQLHelper();
     db.sql = "SELECT * FROM " + com.tablePrefix + "Members WHERE username='" + uname + "'";
     DataTable dt = db.Get_DataTable();
     if (dt.Rows.Count > 0)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:14,代码来源:clsMember.cs

示例12: Button1_Click

        protected void Button1_Click(object sender, EventArgs e)
        {
            string pwd = txtPwd.Text;
            string newPwd = txtNewPwd.Text;
            string newPwd2 = txtNewPwd2.Text;
            if (pwd.Length == 0)
            {
                alert.Show(Page, "请填写原密码");
                return;
            }
            if (newPwd.Length == 0)
            {
                alert.Show(Page, "请填写新密码");
                return;
            }
            if (newPwd != newPwd2)
            {
                alert.Show(Page, "新密码与确认新密码不一致");
                return;
            }

            string memberName = Session["AdminName"].ToString();
            SQLHelper db = new SQLHelper();
            db.sql = "SELECT pwd FROM " + com.tablePrefix + "admin WHERE username='" + memberName + "'";
            DataTable dt = db.Get_DataTable();

            pwd = com.MD5(pwd, 1);
            newPwd = com.MD5(newPwd, 1);

            if (dt.Rows.Count > 0)
            {
                if (pwd != dt.Rows[0]["pwd"].ToString())
                {
                    alert.Show(Page, "原密码错误");
                    return;
                }
                else
                {
                    db.sql = "UPDATE admin SET Pwd='" + newPwd + "' WHERE username='" + memberName + "'";
                    db.ExecSql();
                    alert.Show(Page,"修改成功");
                }
            }
            else
            {
                Response.Redirect("Login.aspx");
            }
        }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:48,代码来源:pwd.aspx.cs

示例13: bindGv

        public void bindGv()
        {
            pid = hPid.Value;
            string sql = @"SELECT b.lbname,c.lbid AS Pid,c.lbname AS Pname, a.*
            FROM "[email protected]"News  a
            INNER JOIN "[email protected]"lb b ON a.lbid=b.lbid
            INNER JOIN "[email protected]"lb c ON b.parentid=c.lbid
            WHERE c.lbid =" + pid;
            sql += " ORDER BY a.isTop DESC,a.IsIndex DESC,a.AddTime DESC";
            SQLHelper db = new SQLHelper();
            db.sql = sql;
            DataTable dt = db.Get_DataTable();

            GV.DataSource = dt.DefaultView;
            GV.DataBind();
        }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:16,代码来源:Prod.aspx.cs

示例14: setIsIndex

 public string setIsIndex(string newsid)
 {
     string re = "";
     string sql = "SELECT isNull(IsIndex,0) as IsIndex,lbid FROM " + com.tablePrefix + "News WHERE newsid=" + newsid;
     SQLHelper db = new SQLHelper();
     db.sql = sql;
     DataTable dt = db.Get_DataTable();
     if (dt.Rows.Count > 0)
     {
         if (dt.Rows[0][0].ToString() == "0")
             re = "<a href='Prod.aspx?act=IsIndex&value=1&pid=" + pid + "&id=" + newsid + "' style='color:green;'>放到首页</a>";
         else
             re = "<a href='Prod.aspx?act=IsIndex&value=0&pid=" + pid + "&id=" + newsid + "' style='color:red;'>取消首页</a>";
     }
     return re;
 }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:16,代码来源:Prod.aspx.cs

示例15: setTopBtn

 public string setTopBtn(string newsid)
 {
     string re = "";
     string sql = "SELECT isNull(isTop,0) as isTop,lbid FROM " + com.tablePrefix + "News WHERE newsid=" + newsid;
     SQLHelper db = new SQLHelper();
     db.sql = sql;
     DataTable dt = db.Get_DataTable();
     if (dt.Rows.Count > 0)
     {
         string lbid = dt.Rows[0]["lbid"].ToString();
         if (dt.Rows[0][0].ToString() == "0")
             re = "<a href='News.aspx?act=top&lbid=" + lbid + "&id=" + newsid + "'>置顶</a>";
         else
             re = "已置顶";
     }
     return re;
 }
开发者ID:uwitec,项目名称:dx-shopsys,代码行数:17,代码来源:news.aspx.cs


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