日期:2014-05-17  浏览次数:20774 次

关于Combox简单赋值的问题

 /// <summary>
        /// 根据数据类型  返回加载后的ComboBox
        /// </summary>
        /// <param name="type">分为字符型T 数字型N 时间型D 是否型B</param>
        /// <returns></returns>
        private ComboBox GetOperateCombox(string type)
        {
            try
            {
                if (dtOperate == null)
                {
                    dtOperate = Qport.Framework.DBAccess.DataAccess.Instance(QportGlobalParam.strStatDB).SelectDataTable("select * from stat_operate_define");
                }
                ComboBox cb = new ComboBox();
                cb.DropDownStyle = ComboBoxStyle.DropDownList;
                cb.DisplayMember = "operate_disp_name";
                cb.ValueMember = "operate_start_code";
                string strType;
                if (type == "N")
                {
                    strType = "num";
                }
                else if (type == "D")
                {
                    strType = "datetime";
                }
                else if (type == "B")
                {
                    strType = "bool";
                }
                else
                {
          &nb