ASP.Net GridView sample

Here is a quick sample to use Asp.Net GridView without any coding.

I have used VS2010 ,.Net framework 4.0.

Steps :

1. Start your VS ans create new Asp.net web site project. This will create a default application template

2. Right click on the website and select “Add New Items”. Add ADO.Net Data Entity.

folow the wizard as shown in the screens below .

                   

This will connect to your database (in my case Northwind sample database  . This can be download from here)

Note : See the option to automatically generate operation for CRUD operation.

4. Now go to VS tool bod  and drag and drop a gridview control on the page. and cnfigure it as shown in the below screen shots

                                   

5. Hit F5 and thats it . You see  Grid as shown below .

         

6. Paging  and sorting is also integrated .

Please click here to download the code for this small application. Please change the connection string to your databse in web.config to  run this sample.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s