logging in or signing up LINQ, DLINQ, XLINQ TechMind Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 2358 Category: Education License: All Rights Reserved Like it (3) Dislike it (2) Added: March 06, 2008 This Presentation is Public Favorites: 0 Presentation Description “Language Integrated Query” Evolution of application data management Coming with C# 3.0 and VB.NET 9.0 Comments Posting comment... By: puneetbansal08 (36 month(s) ago) need to give presentaion on this , plz can you send it to my mail puneetbansal08@gmail.com Saving..... Post Reply Close By: TechMind (35 month(s) ago) Download Allowed for this presentation. Can download from here now. -- Cheers!! Saving..... Edit Comment Close Premium member Presentation Transcript LINQ, DLINQ and XLINQ: LINQ, DLINQ and XLINQ Harjeet Singh C# 3.0What 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 BoxPhilosophy 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 gapWhat 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 PresentationStandard Query Operators: Standard Query Operators Source: Anders Hejlsberg’s PDC PresentationDLinq: 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 checksDLinq: 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 collectionsDLinq: 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 proceduresXLinq: 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 intensiveXLinq: 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 fasterXLinq: 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 namespaceBenefits 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 / APIsResources: Resources LINQ Project Home Page http://msdn.microsoft.com/data/ref/linq/ Anders Hejlsberg – LINQ http://channel9.msdn.com/showpost.aspx?postid=114680 LINQ Project Overview Whitepaper http://msdn.microsoft.com/data/ref/linq/default.aspx?pull=/library/en-us/dndotnet/html/linqprojectovw.asp You do not have the permission to view this presentation. In order to view it, please contact the author of the presentation.
LINQ, DLINQ, XLINQ TechMind Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 2358 Category: Education License: All Rights Reserved Like it (3) Dislike it (2) Added: March 06, 2008 This Presentation is Public Favorites: 0 Presentation Description “Language Integrated Query” Evolution of application data management Coming with C# 3.0 and VB.NET 9.0 Comments Posting comment... By: puneetbansal08 (36 month(s) ago) need to give presentaion on this , plz can you send it to my mail puneetbansal08@gmail.com Saving..... Post Reply Close By: TechMind (35 month(s) ago) Download Allowed for this presentation. Can download from here now. -- Cheers!! Saving..... Edit Comment Close Premium member Presentation Transcript LINQ, DLINQ and XLINQ: LINQ, DLINQ and XLINQ Harjeet Singh C# 3.0What 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 BoxPhilosophy 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 gapWhat 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 PresentationStandard Query Operators: Standard Query Operators Source: Anders Hejlsberg’s PDC PresentationDLinq: 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 checksDLinq: 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 collectionsDLinq: 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 proceduresXLinq: 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 intensiveXLinq: 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 fasterXLinq: 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 namespaceBenefits 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 / APIsResources: Resources LINQ Project Home Page http://msdn.microsoft.com/data/ref/linq/ Anders Hejlsberg – LINQ http://channel9.msdn.com/showpost.aspx?postid=114680 LINQ Project Overview Whitepaper http://msdn.microsoft.com/data/ref/linq/default.aspx?pull=/library/en-us/dndotnet/html/linqprojectovw.asp