Blog
    C#
    ADO.Net
    .NET
    ASP.Net & Web Forms
    Custom Controls
    Web Development
    Exception Handling
    XML
    Database
    Security in .Net
    Testing
    Web Services
    Windows Services
    Windows Controls
    WCF
    AJAX
    WPF
    XAML
    Reporting
    Setup
    VB.Net
    LINQ
    JQuery
    SilverLight
    JavaScript
    HTML5
    Crystal Report
    Cloud Computing
    Share Point
    Visual C++
    MVC
    Android
    PHP
    Java
    HTML
    WordPress
    Joomla
    Products
    Drupal
    Windows Phone
    JSON
    LightSwitch
    iPhone/iPad
    Ruby on Rails
    IIS 7
    Windows 8
    CSS/CSS3
    Excel
    MS Access
    Shortcut Keys
    Visual SourceSafe
    Team Foundation Server
    APIs
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Top Contributor
Advertisement
Advertise with Us
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog
Report Abuse Form
Reason:    
 

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

Basics of LINQ
Views: 2104     Comments: 4
by Gaurav Shukla on 11/10/2011
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:-

System.Data.Linq.dll
System.Linq.dll

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)

DAL.cs

using System;
using System.Data.Linq;

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

BL.cs

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

[Table(Name="student_detail")]
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; }
}

Default.aspx.cs

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;
      gv.DataBind();
    }

Basics of LINQ
by Anurag Sharma on 11/11/2011
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.
Thanks
Report Abuse

LINQ
by Uttam Misra on 11/11/2011
Nice Blog for beginners..
Report Abuse

Basics of LINQ
by Jenry Hock on 11/11/2011

Nice blog Gaurav,

Could you please provide some more blog on concept of LINQ

Thanks,

Report Abuse

Basics of LINQ
by Gaurav Shukla on 11/11/2011
Hi Friends,

I provides as soon as possible more information.
U can visit my blog on this link....
http://dotnetcorecollection.blogspot.com/

Report Abuse
Title :  
Comment :
Text ColorBackground Color
BoldItalicUnderline
LeftCenterRightJustify
Ordered ListBulleted List
IndentOutdent
Horizontal Rule
SubscriptSuperscript
HyperlinkImage
Design ModeDesign
View HtmlHtml
       
 
Report Abuse Form
Reason:    
 
Latest ArticleRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Latest Blogs by Gaurav ShuklaRSS Feed
    
    
More...
Top Viewed ArticlesRSS Feed
    
    
    
    
    
    
    
    
    
    
Top Viewed BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
Latest Interview QuestionsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Total Online Users: 6477
  
Copyright © 2009 - 2013MindStick. All Rights Reserved.