Connect to a SQL database

  • Thread starter Thread starter Claudia Fong
  • Start date Start date
C

Claudia Fong

Hello everybody,

I'm connecting my C# application with a SQL databse, it's my first time,
usually I use access database.

I have a question: I want to load the data of my db into the combo box
when the the form load.

In my invoice table I have nbr as primary key, invoice_nbr and
client_name data.

I want to load into the combobox1 all the invoice_nbr and in combobox2
all the client_name.


How can I do that?

Cheers!

Claudi
 
First, you can put components called DataSource. And setting the
provider of these to your access file.
Second, you click on the combobox you put on the screen and find
"datasource" item in properties window. And modify them into Datasource
component you just built before.
Finally, you can use databinding functionalities.
 
Try adding a datasource component to your interface then databind the
drop downs to the datasource component. This is the easiest way to
hookup a control to a database. Check out the SQL datasource.

~justin
 

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

Back
Top