C# : Filling Data in the Datagridview Based on ComboBox with SQL Server

0
224

DTGFILLCBOfig.3

 

In this tutorial, I’m going to show you how to fill the data in the Datagridview based on Combobox using C# and SQL Server. The process of this method is very simple, wherein you can easily retrieve the list of records that you have saved in the database and be loaded into the list control of a Combobox in the Datagriview.

These are the following steps:

note : For the database of this project just click here.

Step 1. Open Microsoft Visual Studio and create a new windows form application in C#. Then, drag a DataGridview on the form.

DTGFILLCBOfig.1

Step 2. Go to the solution explorer, click the “code view” to display the code editor.

DTGFILLCBOfig.2

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

Step 4. Create a method for filling data in a ComboBox.

Step 5. Go back to the design view, double-click the form and do the following codes for setting up the connection between SQL Server 2005 Express Edition and C#.Net. Then, call the “LoadCombo” method that you have created.

Output:

DTGFILLCBOfig.3

For all students who need a programmer for your thesis system or anyone who needs a source code in any a programming languages. You can contact me @ :

 

 

Email – [email protected]
Mobile No. – 09305235027 – TNT

 

Download Source Code

Facebook Comments

LEAVE A REPLY

Please enter your comment!
Please enter your name here

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