C# – ComboBox with ADO.NET

5 pts.
Tags:
ADO.NET
C
ComboBox
A combobox is provided in the form and I want to display a particular column from a table in the database (SQL). And when I select this particular data corresponding rows should be displayed in the text boxes provide. How should I write the code in C#.

Answer Wiki

Thanks. We'll let you know when a new response is added.

In general terms, you will need to establish the database connection, populate the combo box (or dropdown list) and retrieve the corresponding rows from the database in the “selection changed” event of the combo.

For a guide on how to establish the database connection, have a look at this page.

And for an example on how to manage the ComboBox events, have a look at this one.

————————–

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: