Total Quantity of DataGridview In C# with SQL Server

Calculate the Total Quantity of Books Based on DataGridview In C# with SQL Server


Quantity of DataGridview In C#

Manually counting of books in bookshelves may take you hours before you count it all. Worst, you might be forgetful and you need to start counting again all the books from the start. But, now you have nothing to worry about because this simple automated method will help you out. This method will be the one to calculate the quantity of books that are available. All you have to do is fill out the book names and author in the database and once you clicked the “calculate” button the total number of books will be calculated and displayed in the dataGridview.


Let’s Begin:

How long is 1 million hours | HowTo... x
How long is 1 million hours |

1. Create a database in the SQL server 2005 Express Edition and name it “dbbooks“.

2. Create a table in the database that you have created.

3. Open Microsoft Visual Studio and create a new Windows Form Application for C#. Then, do the form just like this.


4. Go to the solution explorer, click the “code view” to fire the code editor.


5. Initialize the classes and declare the variables that you’re going to use.

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

6. Create a method to display the data in the dataGridview from SQL Server database.

7. Set up the connection between SQL server and Then, call a method that you have created in the fist load of the form.

8. Go back to the design view, double-click the “Calculate” button and do the following codes for calculating the total quantity of books.




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

Project Name : Calculate the Total Quantity of Books Based on DataGridview with SQL Server
Project Platform :C#
Programming Language Used:C# Programming Language
Developer Name
IDE Tool (Recommended):Visual Studio 2019
Project Type :Desktop Application
Upload Date and Time:July 27, 2016- 5:10 am

1 thought on “Total Quantity of DataGridview In C# with SQL Server”

Leave a Comment