At first this post is only for beginner. Here i am introducing the most popular control in asp.net is GridView. A tremendous improvement over asp. Do you think that without writing a single line of code you can present a page with sorting & paging facility? Yes you can do it with few clicks just follow my below steps:
Modify your web.config file to write the connectionstring:
<add name="TestConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=TESTDB;Trusted_Connection=yes;" providerName="System.Data.SqlClient"/>
Note: Modify the connection string as per your Database settings.
Now add a SqlDataSource and follow below steps:
Now click on Finish.
Now Add a GridView in your Page and Follow Below Steps:
Note: Don’t forget to checked “Enable Paging” & “Enable Sorting”. Also set the “PageSize” property as per your requirement from GridView Properties.
Now run the project. Hope you will get an output like below: