Csharp
Csharp

Reputation: 2982

Populating a dropdownlistbox in VB.net 2010 winforms

I am new to winforms and I am trying to populate a dropdownlistbox with data returned from the database. I have a ClaimID & ClaimType.

I can't seem to get the syntax correct. Can anyone help please?

Upvotes: 1

Views: 1756

Answers (1)

Binil
Binil

Reputation: 6583

if your data is in datatable named dt, then

ComboBox1.ValueMember = "ClaimId"
ComboBox1.DisplayMember = "ClaimType"
ComboBox1.DataSource = dt

Upvotes: 1

Related Questions