ADODB.RecordSet and Combobox's

I have the following code to create a record set in a form

Dim db As New ADODB.Connection
Dim dbConString As String = "Provider=sqloledb;server=sql1;uid=itregister;pwd=%T6y7u8i9o;database=itregister"

Dim rsCompany As New ADODB.Recordset
rsCompany.Open("SELECT * FROM Company", db)

I want to set the properties of a combobox using this recordset. I have used the following code

comboboxCompany.ValueMember = rsCompany.Fields("CompanyRef").Value
comboboxCompany.DisplayMember = rsCompany.Fields("CompanyName").Value

When i testand i click the dropdown arrow on the combobox nothing happens. I am new to using ADODB i have always used tableadapters. What am i doing wrong?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ict-torquilclarkAuthor Commented:
This code is in the Form load even
Add this too

comboboxCompany.DataSource = rsCompany
ict-torquilclarkAuthor Commented:
I did try that but i got the following error

Complex DataBinding accepts as a data source either an IList or an IListSource
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

comboboxCompany.DataSource = rsCompany.Tables(0)
ict-torquilclarkAuthor Commented:
Now i get

Public member 'tables' on type 'RecordSetClass' not found
Alfred A.Commented:
Just a suggestion, why don't you convert your RecordSet into a Dataset and then use this DataSet as your data source, so that you would not get the IList/IListSource issue.

Check this out:

I hope this helps.
Carl TawnSystems and Integration DeveloperCommented:
This might be a daft question, but if you've been using TableAdapters before, why are you now taking a step back and using ADODB?
Alfred A.Commented:
Yeah.  I agree with @carl_tawn.  Why are you still using ADODB when there are other powerful data access tools available in .NET and since you are using TableAdapters already?
ict-torquilclarkAuthor Commented:
I was using it because for some reason VS2008 was loading ever tableadapter that i used in my project into the project toolbar - this was seriousley slowing down the loading time for a form when trying to open it in VS.

I found a fix for this and have therefore gone back to using table adapters...

Tools > Options > Windows Form Designer> General > Auto Toolbar Populate = FALSE

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Is the problem sorted?
ict-torquilclarkAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.