Fill many combo in a fORm fROm DB

J

Jassim Rahma

I have a form which has more than 10 combobox controls and all should be
filled from a different fields in different tables in one mySQL
database. I want to do this using the code and not at design time
because I have the connection setting in the registry.

what is the best way to do it (with example please) to make sure the
form loadng won't be too slow..

Many Thanks,
Jassim Rahma
 
P

Peter Bromberg [C# MVP]

I don't know if MySql supports multiple SQL queries concatenated with
semicolons. If it does, issue ten separate queries, one for the
contents of each combobox, and return a DataSet with ten tables in it.

Set the datasource for each combo to the specific table in the DataSet
that applies.

There's lots of sample code at MSDN online or in the Quickstarts. Also,
the documentation for the MySql ADO.NET provider probably also has
sample code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top