Kim_zh

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2013-09-29 17:04:47

1、性别:

   <asp:DropDownList ID="DrpSex" runat ="server"  Width="100px"  CssClass="combox" Height="15px" datatype="*" nullmsg="请选择" errormsg="请选择">
   </asp:DropDownList>

2、政治面貌:

 <asp:DropDownList ID="Drp政治面貌" runat ="server"  Width="100px"  CssClass="combox" Height="15px" datatype="*" nullmsg="请选择" errormsg="请选择"></asp:DropDownList

3、调用存储过程的GetCodeByDH

  protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                #region 获取Drp数据
                DataTable dt = Comm.GetCodeByDH("03");
                DrpSex.DataSource = dt;
                DrpSex.DataTextField = "Chinese";
                DrpSex.DataValueField = "Code";
                DrpSex.DataBind();
                DrpSex.Items.Insert(0, new ListItem("请选择", string.Empty));

                dt = Comm.GetCodeByDH("06");
                Drp政治面貌.DataSource = dt;
                Drp政治面貌.DataTextField = "Chinese";
                Drp政治面貌.DataValueField = "Code";
                Drp政治面貌.DataBind();
                Drp政治面貌.Items.Insert(0, new ListItem("请选择", string.Empty));

      //当然也可以是公用类中的“获取数据”

      dt = Comm.获取数据("批次表", "1", "1", "创建时间 desc");
                Drp批次.DataSource = dt;
                Drp批次.DataTextField = "批次名称";
                Drp批次.DataValueField = "ID";
                Drp批次.DataBind();
                Drp批次.Items.Insert(0, new ListItem("请选择", string.Empty));

      #endregion

       }

   }

posted on 2013-09-29 17:12  Kim.zh  阅读(247)  评论(0编辑  收藏  举报