How to Load Data in the ListView Using C# and SQL Server

How to Load Data in the DataGridView in C# and SQL Server

In this tutorial, I will teach you how to Load Data data in Datagridview using C# and SQL server 2005. This method will help you retrieve data in the database to load those data in the DataGridview. You can also control whatever data you want to display to the DataGridView.



Let’s Begin How to Populate Datagridview using C# and SQL server:


Create a database and name it “persondb”.

After that, do the following query for creating a table in the database that you have created.


Open Microsoft Visual Studio 2008 and create new Windows Form Application for C#. Then do the following design of a Form as shown below.



Go to the Solution Explorer, double click the “View Code”  to display the code editor.



In the code editor, declare all the classes that are needed.

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


After declaring the classes, go back to the design view double click the form and establish a connection between SQL server and

After establishing the connection, go back to the design view double click the button and do the following codes for retrieving data in the database that will display in the ListView.




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

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

Project Name : How to Load Data in the DataGridView in C# and SQL Server
Project Platform :C#
Programming Language Used:C# Programming Language
Developer Name
IDE Tool (Recommended):Visual Studio 2019
Project Type :Desktop Application
Database:MySQL Database
Upload Date and Time:June 18, 2016- 5:59 am

Leave a Comment