Manu Laureys

Manu Laureys

  • NA
  • 40
  • 1.8k

Combobox and ItemArray

Jun 9 2022 10:37 AM

My code:

                string strCmd = "Select ID, Code, Omschrijving From Type Order By Code";
                SqlDataAdapter da = new SqlDataAdapter(strCmd, conn);
                DataSet ds = new DataSet();
                da.Fill(ds);

                cboType.DisplayMember = "Omschrijving";
                cboType.ValueMember = "ID";
                cboType.DataSource = ds.Tables[0];
 

How do I acces de Code in cboType?

If I check the properties, I can see the values in the ItemArary, but I can't access it.

 


Answers (2)