LINQ to SQL ? Part #3


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


Advertisement

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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.