Filling Data in the ComboBox with Two Display Members Using C# and SQL Server


FillCBOtwoDisplayFig.3In this tutorial, I will teach you how to fill the data in the combo box with two display members using and SQL Server 2005 express edition. This method has the capability to display two columns in a combo box from the table of the database. Using concatenation, this guarantees you that it will work because concatenation is a procedure that joins two or more fields in the table of the database.


Here’s the link for creating a database. Click Here


Let’s begin:


Step 1. Open Visual Studio 2008 and create new Windows Form Application. After that, drag a comboBox in the Form.



Step 2. Go to the Solution Explorer, hit the “View Code”  to fire the code editor.



Step 3. Declare and initialize the classes that are needed.

Note: Put “using System.Data.SqlClient;” above the namespace to access sql server library.


Step 4. Create a method for filling data in the comboBox with two display member.


Step 5. Set up the connection between SQL Server database and and call the method that you have created on the first load of the form.



For all students who need a programmer for your thesis system or anyone who needs a source code in any programming languages. You can contact me @ :
Email – [email protected]
Mobile No. – 09305235027 – talk’nText


Download Sourcecode

Looking for more source code? Type your keyword here here!


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.