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

  • 相关阅读:
    c语言 ctype.h中的函数
    sizeof 用法
    [LeetCode] Permutations 解题报告
    [LeetCode] Permutations II 解题报告
    [LeetCode] Next Permutation 解题报告
    [LeetCode] Path Sum II 解题报告
    [LeetCode] Palindrome Number 解题报告
    [LeetCode] Minimum Window Substring 解题报告
    [LeetCode] Partition List 解题报告
    [LeetCode] Pascal's Triangle II 解题报告
  • 原文地址:https://www.cnblogs.com/dfxyw/p/5080104.html
Copyright © 2011-2022 走看看