1 / 9

.NET Language Integrated Query

.NET Language Integrated Query. Yishai Zaltzberg. Agenda:. Why LINQ? What is LINQ Code samples Compare to code without LINQ Simple query Working with Xml Aggregation Join Use SP Etc . Impact and performance. Questions ?. Classic ADO.NET. Application.

Télécharger la présentation

.NET Language Integrated Query

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. .NET Language Integrated Query Yishai Zaltzberg

  2. Agenda: • Why LINQ? • What is LINQ • Code samples • Compare to code without LINQ • Simple query • Working with Xml • Aggregation • Join • Use SP • Etc. • Impact and performance. • Questions ?

  3. Classic ADO.NET Application SqlConnectionconn = new SqlConnection(“...“); SqlCommandcmd = conn.CreateCommand(); cmd.CommandText = @“ SELECT *                     FROM   Vehicles                     WHERE  Model = @Model"; cmd.Parameters.Add("@Model", “Mercedes“); SqlDataReader r = cmd.ExecuteReader(); while ( r.HasRows ) { Console.WriteLine(r[“Number"] + r[“Year"]); } No intellisence No compile time checks Untyped Results Relational Database

  4. LINQ to Objects .NET Language Integrated Query LINQ to Entities LINQ to SQL LINQ to Dataset LINQ to XML XML Objects Relational Data

  5. Samples

  6. Simple Xml Build – Before LINQ

  7. Simple Xml Build

  8. Before LINQ

  9. Build Xml from DB

More Related