Home > DeveloperSection > Blogs > LINQ Implementation on 3-tier application

LINQ Implementation on 3-tier application

4 Comment(s)
 4500  View(s)
Rate this:
Language Integrated Query (LINQ), pronounced simply as 'link' is a is a component released within the .NET 3.5 Framework. It is one of the most powerful features of .NET 3.5. It serves the purpose of querying objects.

Microsoft basically divides LINQ into three areas and that are give below.

    => LINQ to Object {Queries performed against the in-memory data}
    => LINQ to ADO.Net
       * LINQ to SQL (formerly DLinq) {Queries performed against the relation database only Microsoft SQL Server Supported}
       * LINQ to DataSet {Supports queries by using ADO.NET data sets and data tables}
       * LINQ to Entities {Microsoft ORM solution}
    => LINQ to XML (formerly XLinq) { Queries performed against the XML source}

There are two main dll's:-


Three namespace are:-
using System.Data.Linq.Mapping; {for creating entity model or entity class }
using System.Data.Linq; {for fetching the records from database}
using System.Linq; {for perform conditional operation like as "orderby, groupby, where, take etc.... }

Linq features :-
Encapsulated the features of generics.
Avoid boxing and unboxing.
Data is type safe.

Example:- (Add Reference System.Data.Linq)


using System;
using System.Data.Linq;

public class DAL:DataContext
  public DAL(string sCon):base(sCon)


using System;
using System.Data.Linq.Mapping;

public class Student
  [Column(Name = "in_student_id", IsPrimaryKey = true)]
  public int SID { get; set; }

  [Column(Name = "nvc_student_name")]
  public string SNAME { get; set; }

  [Column(Name = "nvc_address")]
  public string SADDRESS { get; set; }

  [Column(Name = "nvc_contact")]
  public string SCONTACT { get; set; }

  [Column(Name = "nvc_email")]
  public string SEMAIL { get; set; }


protected void button_Click(object sender, EventArgs e)
      DAL oDal = new DAL("Data Source=.(localhost);Initial Catalog=testing;Integrated Security=true;");
      Table<Student> otStudent = oDal.GetTable<Student>();
      gv.DataSource = otStudent;

Basics of LINQ

By Anurag Sharma on   4 years ago
can you post more blogs on LINQ as you have posted this one..its good for my learning point of view as I am new for LINQ.


By Uttam Misra on   4 years ago
Nice Blog for beginners..

Basics of LINQ

By Jenry Hock on   4 years ago

Nice blog Gaurav,

Could you please provide some more blog on concept of LINQ


Basics of LINQ

By Gaurav Shukla on   4 years ago
Hi Friends,

I provides as soon as possible more information.
U can visit my blog on this link....

Don't want to miss updates? Please click the below button!

Follow MindStick