c/s中绑定combobox

  private void GetTaskType()
        {
            //初始化任务类型
            string sqlT = "select null codeitemsn,null codeitemname from dual union all select codeitemsn,codeitemname from sys_codeitem where codesn in ( ";
            sqlT += "select codesn from sys_code  where codeid='TASKTYPE')";
            WebCrm cm = new WebCrm("", "");
            try
            {
                DataSet dsType = cm.ContactTaskAdapter(sqlT);
                cmbTaskType.DataSource = dsType.Tables[0];
                cmbTaskType.DisplayMember = dsType.Tables[0].Columns["codeitemname"].ToString();
                cmbTaskType.ValueMember = dsType.Tables[0].Columns["codeitemsn"].ToString();

            }
            catch
            { }
        }

posted on 2011-10-07 13:49  jameshappy  阅读(337)  评论(0编辑  收藏  举报