What is the LINQ to SQL?
This is one of the most useful and the easiest method to do database operation with sqlserver
- Its all features located in System.Data.Linq
- It also include basic object relation (O/R) mapper directly in Visual studio.
- The O/R mapper enables you to quickly map sql-based datasource to CLR object.
How to use LINQ to SQL ?
Steps1: Add a LINQ to SQL Class like this
Step2: Drag the Database table which one you are going to use.
Step3 : Save the page(Ctrl + s) where serialization mode=”Unidirectional”
like this image
Step4: Then In Design page, take one Gridview and Linqdatasource control and configure the Linqdatasource control like this
Step5: You will get op like this