在C#中有两列的ComboBox

时间:2012-10-19 15:01:16

标签: c#

  

可能重复:
  WinForms combobox with multiple columns (C#)?

我这个程序 ALTER proc [dbo]。[VCNAE] 如 通过cnae_descricao从tbl_CNAE订单中选择cnae_id,cnae_descricao,cnae_classe

我用来填充这个数据集

        SqlCommand llena4 = new SqlCommand("vcnae", abre);
        llena4.CommandType = CommandType.StoredProcedure;
        da2.SelectCommand = llena4;
        da2.Fill(carga1, "cnae");//4

然后我填充组合框

         BindingSource srd = new BindingSource();
         srd.DataSource = llenar.Tables["cnae"];
         CmbCnaePrin.DataSource = srd;
         CmbCnaePrin.DisplayMember = "cnae_descricao" ;
         CmbCnaePrin.ValueMember = "cnae_id";
         CmbCnaePrin.SelectedValue = 259;

我想在显示成员中显示:

cnae_descricao,cnae_classe

                     displaymember = "cnae_descricao"+"cnae_classe"; but this code not work how can  i solve this::????

谢谢

0 个答案:

没有答案