zoukankan      html  css  js  c++  java
  • asp.net中如何绑定combox下拉框数据(调用存储过程)

    #region 绑定类型(商品类型、仓库名称)

            public void DataType_Bind(int _peoid)

            {

                DataTable dt_goodsname = new DataTable();

                dt_goodsname = stockbll.GetList_goodstype(_peoid).Tables[0];  //获取商品类别

                this.cb_goodstype.Items.Clear();

                foreach (DataRow dr in dt_goodsname.Rows)

                {

                    string id = dr["goodstype2_id"].ToString();  //商品类别id

                    string title = dr["GOODSTYPE2NAME"].ToString();  //商品类别名称

                    this.cb_goodstype.Items.Add(title, id);    //商品类别绑定 

                }

                DataTable dt_stockname = new DataTable();

                dt_stockname = stockbll.GetList_stockname(_peoid).Tables[0];  //获取仓库名称

                this.cb_stock.Items.Clear();

                foreach (DataRow dr in dt_stockname.Rows)

                {

                    string stock_id = dr["GENSTORAGEID"].ToString();   // 仓库id

                    string stock_title = dr["GENSTORAGENAME"].ToString();  //仓库名称

                    this.cb_stock.Items.Add(stock_title, stock_id);   //仓库名称绑定

                }

                this.cb_stock.DataBind();

                this.cb_goodstype.DataBind();

            }

            #endregion

  • 相关阅读:
    css文档之盒模型阅读笔记
    《图解HTTP》阅读总结
    好博客-持续收藏中。。。
    Linux下Nagios的安装与配置
    在Linux上使用logwatch分析监控日志文件
    根据Request检测是否为移动端设备访问
    MyEclipse启动一直停留在Loading workbench界面上的处理
    使用JSONP进行跨域请求
    Page.java
    JsonUtil.java
  • 原文地址:https://www.cnblogs.com/dfxyw/p/5080104.html
Copyright © 2011-2022 走看看