33 %
67 %
Information about LINQ, DLINQ, XLINQ

Published on March 6, 2008

Author: TechMind


LINQ, DLINQ and XLINQ:  LINQ, DLINQ and XLINQ Harjeet Singh C# 3.0 What is LINQ?:  What is LINQ? “Language Integrated Query” Evolution of application data management Coming with C# 3.0 and VB.NET 9.0 Goals Provide overview of the LINQ project Point out learning resources for self study Next week - LINQ practical Anders Hejlsberg Don Box Philosophy of C# 3.0 And LINQ:  Philosophy of C# 3.0 And LINQ Integrates object, relational semi-structured data models. By generalization, rather than by ad-hoc specializations Similar to database systems which now integrate the relational and XML data model SQL and XQuery. The Problem:  The Problem Worlds of OO and data access are far, far apart OO language types and native database types are often different SQL code is “inside the quotes” No strong typing or compile-time type checking No Intellisense No Statement completion SQL and XML have query languages, objects to not LINQ seeks to bridge the gap What is LINQ?:  What is LINQ? Standard Query Operators DLinq (ADO.NET) XLinq (System.Xml) .NET Language Integrated Query C# VB Others… Source: Anders Hejlsberg’s PDC Presentation Standard Query Operators:  Standard Query Operators Source: Anders Hejlsberg’s PDC Presentation DLinq:  DLinq A means of managing relational data SqlConnection c = new SqlConnection(…); c.Open(); SqlCommand cmd = new SqlCommand( @"SELECT c.Name, c.Phone FROM Customers c WHERE c.City = @p0"); cmd.Parameters.AddWithValue("@p0", "London“); DataReader dr = c.Execute(cmd); while (dr.Read()) { string name = dr.GetString(0); string phone = dr.GetString(1); DateTime date = dr.GetDateTime(2); } dr.Close(); Accessing data today: Queries in quotes Loosely bound arguments Loosely typed result sets No compile time checks DLinq:  DLinq public class Customer { … } public class Northwind: DataContext { public Table<Customer> Customers; … } Northwind db = new Northwind(…); var contacts = from c in db.Customers where c.City == "London" select new { c.Name, c.Phone }; Accessing data with DLinq Classes describe data Strongly typed connection Integrated query syntax Strongly typed results Tables are like collections DLinq:  DLinq Language integrated data access Maps tables and rows to classes and objects Builds on ADO.NET and .NET Transactions Mapping Encoded in attributes Relationships map to properties Persistence Automatic change tracking Updates through SQL or stored procedures XLinq:  XLinq XmlDocument doc = new XmlDocument(); XmlElement contacts = doc.CreateElement("contacts"); foreach (Customer c in customers) if (c.Country == "USA") { XmlElement e = doc.CreateElement("contact"); XmlElement name = doc.CreateElement("name"); name.InnerText = c.CompanyName; e.AppendChild(name); XmlElement phone = doc.CreateElement("phone"); phone.InnerText = c.Phone; e.AppendChild(phone); contacts.AppendChild(e); } doc.AppendChild(contacts); Programming XML today <contacts> <contact> <name>Great Lakes Food</name> <phone>(503) 555-7123</phone> </contact> … </contacts> Imperative model Document centric No integrated queries Memory intensive XLinq:  XLinq XElement contacts = new XElement("contacts", from c in customers where c.Country == "USA" select new XElement("contact", new XElement("name", c.CompanyName), new XElement("phone", c.Phone) ) ); Programming XML with XLinq Declarative model Elementcentric Integrated queries Smaller and faster XLinq:  XLinq Language integrated query for XML Expressive power of XPath / XQuery But with C# or VB as programming language Leverages experience with DOM Element centric, not document centric Functional construction Text nodes are just strings Simplified XML namespace support Faster and smaller What is LINQ?:  What is LINQ? The LINQ project is: Language Integrated Query for .NET Native query syntax for .NET languages Standard Query Operators SQL-like method extensions for any .NET collection System.Query namespace DLinq Code name for future version of ADO.NET Query enabled data access framework System.Data.Xlinq namespace XLinq Query enabled, smaller, faster XML DOM System.XML.Xlinq namespace Benefits of LINQ:  Benefits of LINQ Unified querying of objects, relational, XML Type checking and IntelliSense for queries SQL and XQuery-like power in C# and VB Extensibility model for languages / APIs Resources:  Resources LINQ Project Home Page Anders Hejlsberg – LINQ LINQ Project Overview Whitepaper

Add a comment

Related presentations

Related pages

LINQ (Language-Integrated Query) -

LINQ (Language-Integrated Query) Visual Studio 2015 Other Versions Visual Studio 2013 ; Visual Studio 2012; Visual Studio 2010.NET Framework 3 ...
Read more

c# - What is the difference between Linq, DLinq and XLinq ...

I am reading about Linq. Please explain to me how Linq, DLinq and XLinq are different.
Read more

c# - LINQ to read XML - Stack Overflow

LINQ to read XML. up vote 155 down vote ... C# Load XML using XLINQ (LINQ to XML) – user1521684 Jul 28 '12 at 6:26. ... using System.Linq; using System ...
Read more

Basics of LINQ & Lamda Expressions - CodeProject

Basics of LINQ & Lamda Expressions. Abhishek Sur, ... Use of Let within Linq ; DLINQ (LINQ TO SQL) XLINQ (LINQ TO XML) Reference ; Conclusion; History ...
Read more

Language Integrated Query - Wikipedia

Language Integrated Query (LINQ, ... LINQ to XML (formerly called XLINQ) ... (formerly called DLINQ) The LINQ to SQL provider allows LINQ to be used ...
Read more

101 LINQ Samples in C# -

101 LINQ Samples Learn how to use LINQ in your applications with these code samples, covering the entire range of LINQ functionality and ...
Read more

LINQ in Action - THE LINQ book - Blogs

Learn about the LINQ in Action book and the LINQ technology: LINQ to Objects, LINQ to SQL (DLINQ), LINQ to XML (XLINQ) and more...
Read more

DLINQ XLINQ integration -

DLINQ XLINQ integration. Archived ... Would it be possible in the final version of DLINQ to run XLINQ queries against xml data type in SQL ... LINQ to XML ...
Read more

ScottGu's Blog - Using LINQ with ASP.NET (Part 1)

One of the new things I’m super excited about right now is the LINQ family of technologies that are starting to come out (LINQ, DLINQ, XLINQ and others ...
Read more

XLINQ Introduction Part 3 Of 3 - CodeProject

XLINQ Introduction Part 3 Of 3. Sacha Barber, ... so I thought I would write an article about what I have learned in the LINQ/DLINQ/XLINQ areas, ...
Read more