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

  • 相关阅读:
    Delphi中 StrToIntDef函数的用法:
    Delphi判断文件夹(目录)是否存在,不存在就创建一个,可以一次创建多级目录
    Delphi中Format的字符串格式化使用说明
    linux下可变参数打印
    c++11 thread
    QMessageBox 使用
    Ubuntu虚拟机配置nfs
    test
    Qt 布局时组建不贴边
    QPainter 居中写字
  • 原文地址:https://www.cnblogs.com/dfxyw/p/5080104.html
Copyright © 2011-2022 走看看