This is one of the most useful and the easiest method to do database operation with sqlserver
Just Follow these simple steps:

Step 1: Add a LINQ to SQL Class like this


LingtoSql1.gif

Step 2: Drag the Database table which one you are going to use.


LingtoSql2.gif

Step 3: Save the page(Ctrl + s) where serialization mode=”Unidirectional” like this image


LingtoSql3.gif

Step 4: Then In Design page, take one Gridview and Linqdatasource control and configure the Linqdatasource control like this


LingtoSql4.gif

LingtoSql5.gif

Step 5: You will get output like this

LingtoSql6.gif