C# – ComboBox with ADO.NET

5 pts.
Tags:
ADO.NET
C
ComboBox
A combobox is provided in the form and i wan to display a particular column from athe table in the database(sql). and when i select this particular data corresponding rows should be displayed in the textboxes 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 stablish 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 stablish the database connection, have a look at <a href=”http://www.codeproject.com/KB/database/sql_in_csharp.aspx”>this page</a>

And for an example on how to manage the ComboBox events, have a look at <a href=”http://www.java2s.com/Tutorial/CSharp/0460__GUI-Windows-Forms/ComboBoxselectionchangedevent.htm”>this one</a>.

————————–

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following