C# How to Show / Display Data in DataGridView from Sql Server Database | Retrieve Load in WinForms

preview_player
Показать описание
Topic: C# How to Show / Display Data in DataGridView from Sql Server Database | Retrieve Load in WinForms - In Urdu / Hindi

In previous lecture we discussed in detail about C# to SQL Server connection (c# connection).

We will learn 2 approaches to Select Data from SQL Database and Display it in DataGridview c#.
Chapters:
0:00 Introduction
0:31 Using DataTable
5:56 Manually (add rows one by one in gridview)

In method 1, we will fetch data from sql server database using sqlcommand & sqldatareader object and then load it into c# datatable. The datatable will then be used as datasource to c# datagridview control.

While in method 2, we will manually retrieve data (all rows) from sqldatareader and add to datagridview one by one. In this method we will have full access to data, we can easily manipulate our data before displaying to c sharp winform application.

In-code steps for C# SQL connection may include:1. Address of SQL server and database (sql connection string)2. Establish connection (c# sqlconnection class)3. Open connection (c# sqlconnection open)4. Prepare SQL query 5. Execute query (c# sqlcommand class)6. Close connection (c# sqlconnection close)

Technologies used: Visual Studio, SQL Server Management Studio, C# programming lanugageThis video can also be searched as:
-how to fetch data from database to datagridview in c#-how to show data in datagridview in c# without using database-how to show data from database in datagridview in c#-how to display data in gridview in android from sql server database-how to show data in datagridview in c# from mysql database-how to fetch data from database in php and display in gridview-how to display data in datagridview in c# net windows application-binding datagridview to sql database
-how to display database table in c# datagridview-how to show data in datagridview in c# from sql server-c# tutorials - load data into datagridview from sql server database-programming with c#: retrieve data from database and display in datagridview c#-load data into datagridview from sql server database using datareader in c#-c# tutorial : retrieve data from sql server database-how to retrieve data from database and display in gridview-c# tutorials - load data into datagridview from mysql database
#DataGridView #CSharp #SQLServer #Database #VisualStudio #AakashAsswani
Рекомендации по теме
Комментарии
Автор

awesome teaching! simple and precise, appreciated!

hyunzae
Автор

Excellent explanation bhai simple and step by step ✨

mashhood
Автор

Superb step by step explanation bhai thank you

liquidsilver
Автор

Hey there, glad to meet you again with another enquiry.
Is there any approach or tools through which i can design sql applications that is simultaneously compatible with both Mac
and windows systems. The application is not tied to a website but it is an application to be placed over a network
in a company (client-server relation network).
Thanks for giving me any advice on this.

hasanmougharbel
Автор

I want to ask a question, Sir i copied the same code you were writing if I press Show data one time its ok the data is displayed on the grid but if a press show data again the same data is shown again, its like old data x 2 .Each time show data is pressed the same number of time data is printed . Is there any way to just refresh the data and show only the new data inserted not the whole list again and again

hamzaahmed
Автор

Sir listbox database sa connect ho or hum koi item select karen to wo hum datagridview ma kasay show karay saktay hn

NPGAMINGOfficial
Автор

Axha jo hm c# ma datagridview data enter krtay ha usay sql ma kaisay show krwaya gay....es baray thori help kr dai..

MuhammadWaqas-ebuu
welcome to shbcf.ru