 Language Integrated Query  Make query a part of the language  Component of.NET Framework 3.5  Shipped with Visual Studio 2008.

Slides:



Advertisements
Similar presentations
The Microsoft Technical Roadshow 2007 Language Enhancements and LINQ Daniel Moth Developer & Platform Group Microsoft Ltd
Advertisements

Language Integrated Query (LINQ) Martin Parry Developer & Platform Group Microsoft Ltd
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
.NET 3.5 – Mysteries. NetFx Evolution NetFx 1.0 C# 1.0, VB 7.0, VS.NET NetFx 1.1 C# 1.1, VB 7.1, VS 2003 NetFx 2.0 C# 2.0, VB 8.0, VS 2005 NetFx 3.0 C#
.NET Database Technologies: Open-Source Frameworks.
Damien Guard (BSc, MBCS) Guernsey Software Developer Forum Language Integrated Query:
Fundamentals, Design, and Implementation, 9/e Chapter 12 ODBC, OLE DB, ADO, and ASP.
.NET Framework V3.5+ & RESTful web services Mike Taulty Developer & Platform Group Microsoft Ltd
Fundamentals, Design, and Implementation, 9/e COS 346 DAY 22.
C# Programming: From Problem Analysis to Program Design1 Advanced Object-Oriented Programming Features C# Programming: From Problem Analysis to Program.
The Microsoft Technical Roadshow 2007 Advances for Data in VS “Orcas” Mike Taulty Developer & Platform Group Microsoft Ltd
What’s new in ASP.NET 3.5? Mike Ormond Developer & Platform Group Microsoft Ltd
2.3 Cool features in C# academy.zariba.com 1. Lecture Content 1.Extension Methods 2.Anonymous Types 3.Delegates 4.Action and Func 5.Events 6.Lambda Expressions.
A tour of new features introducing LINQ. Agenda of LINQ Presentation We have features for every step of the way LINQ Fundamentals Anonymous Functions/Lambda.
Discover, Master, InfluenceSlide 1 SQL Server Compact Edition and the Entity Framework Rob Sanders Readify.
Overview of Database Access in.Net Josh Bowen CIS 764-FS2008.
XML files (with LINQ). Introduction to LINQ ( Language Integrated Query ) C#’s new LINQ capabilities allow you to write query expressions that retrieve.
LINQ Programming in C# LINQ CSE Prof. Roger Crawfis.
 Introduction  What is LINQ  Syntax  How to Query  Example Program.
Slides from Gang Luo, Xuting Zhao and Damien Guard
Integrating XML with Microsoft SQL Server ©NIITeXtensible Markup Language/Lesson 9/Slide 1 of 31 Objectives In this lesson, you will learn to: * Generate.
Databases and LINQ Visual Basic 2010 How to Program 1.
LINQ, An IntroLINQ, An Intro Florin−Tudor Cristea, Microsoft Student Partner.
Eric Vogel Software Developer A.J. Boggs & Company.
Entity Framework, a quickstart Florin−Tudor Cristea, Microsoft Student Partner.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
ASP.NET  ASP.NET is a web development platform, which provides a programming model, a comprehensive software infrastructure and various services required.
NHibernate in Action Web Seminar at UMLChina By Pierre Henri Kuaté 2008/08/27
COMP 410 & Sky.NET May 2 nd, What is COMP 410? Forming an independent company The customer The planning Learning teamwork.
Intro to C#.net and EF Ilan Shimshoni. The Three Faces of ADO.NET The connected layer – Directly connecting to the DB The disconnected layer – Using datasets.
Overview of Data Access MacDonald Ch. 15 MIS 324 Professor Sandvig.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
Putting it all together: LINQ as an Example. The Problem: SQL in Code Programs often connect to database servers. Database servers only “speak” SQL. Programs.
LINQ TO XML Mike Taulty Developer & Platform Group Microsoft UK
Introduction to LINQ Lecture # 19 August Introduction How do you interrogate/manipulate data? What if you could do the work in a type-safe," string-free.
LINQ: It’s Not Your Father’s Data Access Denny Boynton Anheuser-Busch Companies.
The.NET Language Integrated Query Project Anders Hejlsberg TLN306 Technical Fellow Microsoft Corporation.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
Oct * Brad Tutterow. VS 2008.NET 3.5LINQ Entity Framework  The ADO.NET Entity Framework is part of Microsoft’s next generation of.NET technologies.
Ventsislav Popov Crossroad Ltd.. 1. ASP.NET Data Source Controls  SqlDataSource  EntityDataSource  ObjectDataSource 2. Entity Data Model and ADO.NET.
1 ADO.NET Data Services Mike Taulty Developer & Platform Group Microsoft Ltd
Presented by Vishy Grandhi.  Architecture (Week 1) ◦ Development Environments ◦ Model driven architecture ◦ Licensing and configuration  AOT (Week 2)
Applied Linq Putting Linq to work Introducing… Class-A Kennisprovider Microsoft development Training Coaching Alex Thissen Trainer/coach.
LINQ & PLINQ (Parallel) Language Integrated Query.
CSCI 3327 Visual Basic Chapter 8: Introduction to LINQ and Collections UTPA – Fall 2011.
Database Connectivity with ASP.NET. 2 Introduction Web pages commonly used to: –Gather information stored on a Web server database Most server-side scripting.
Linq Overview Vincent GERMAIN. Evolution - Rappel Langage  C# 2.0  C# 3.0 (Local type inference, Lambda expression, Method extension,Anonymous type)
Damien Guard (BSc, MBCS) Guernsey Software Developer Forum Language Integrated Query:
Joel Pobar Language Geek Microsoft DEV320 Improve on C# % Backwards Compatible Language Integrated Query (LINQ)
LINQ Language Integrated Query LINQ1. LINQ: Why and what? Problem Many data sources: Relational databases, XML, in-memory data structures, objects, etc.
ADO.NET 3.0 – Entity Data Model Gert E.R. Drapers Chief Software Architect Visual Studio Team Edition for Database Professionals Microsoft Corporation.
Language Integrated Query Mike Taulty Developer & Platform Group Microsoft Ltd
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
Introduction to Entity framework
Part 1: Overview of LINQ Intro to LINQ Presenter: PhuongNQK.
Microsoft Visual Basic 2010: Reloaded Fourth Edition
Visual Basic 2010 How to Program
Introduction to Entity Framework
Jim Fawcett CSE681 – Software Modeling and Analysis Fall 2016
Jim Fawcett CSE681 – Software Modeling and Analysis Fall 2013
Intro to LINQ Part 2 – Concepts and LINQ to Objects
Language Integrated Query: (LINQ) An introduction
ADO.NET Entity Framework
Data Model.
Visual Studio + SQL Server Is Better
04 | Data Acess Technologies
ADO.NET Entity Framework
.NET Framework V3.5+ & RESTful web services
CS4540 Special Topics in Web Development LINQ to Objects
Presentation transcript:

 Language Integrated Query  Make query a part of the language  Component of.NET Framework 3.5  Shipped with Visual Studio 2008

 Linq is short for L anguage In tegrated Q uery. If you are used to using SQL to query databases, you are going to have something of a head start with Linq, since they have many ideas in common.

 LINQ provides a high-level abstraction of virtually any data and emulates the query operations of the relational model.

 Language Integrated Query ( LINQ, pronounced "link") is a Microsoft.NET Framework component that adds native data querying capabilities to.NET languages.Microsoft.NET Framework querying.NET languages

 LINQ (often overheard pronounced as "link") is a step in the evolution of data access. It is a programming model that brings a much needed uniformity to accessing data from files, XML, database, registry, event log

 Allows to perform iterations on Collections  Main namespace is System.core

C# var myCustomers = from c in customers where c.Region == "UK" select c;

 Unified data access Single syntax to learn and remember  Strongly typed Catch errors during compilation  IntelliSense Prompt for syntax and attributes  Bindable result sets  More evident when more complex filters are present

OthersC#VB.NET.NET Language Integrated Query (LINQ) LINQ to SQL LINQ to Objects LINQ to XML LINQ to Datasets LINQ to Entities LINQ data source providers ADO.NET support for LINQ

 C# int[] nums = new int[] {0,4,2,6,3,8,3,1}; double average = nums.Take(6).Average(); var above = from n in nums where n > average select n;  Filtering process is easy because of the Intellisense feature

 Use of Ienumerable or Iqueryable collection  Query any IEnumerable source Includes arrays, List, Dictionary...  Instead of for each loops or iterative loops the condition of LINQ used along with Ienumerable helps in rapid data retrieval

AggregateConversionOrderingPartitioningSets Aggregate Average Count Max Min Sum Cast OfType ToArray ToDictionar y ToList ToLookup ToSequenc e OrderBy ThenBy Descending Reverse Skip SkipWhile Take TakeWhile Concat Distinct Except Intersect Union and many others

 LINQ to dataset is build on the top of ADO.Net to simplify the tasks  Ensure that a reference System.Data.DataSetExtensions.dll is added  Typed dataset feture is present(Fields)  Reshaping data with Anonymous type feature

 What is the Entity Data Model? Definition for your application model Map between app model, database schema Advanced mapping scenarios supported One entity mapped across multiple tables  Multiple inheritance hierarchy mappings  Many-to-many without "link" table in model

 LINQ to SQL Shipped with Visual Studio 2008 and.NET 3.5 Emphasis on rapid application development Supports Microsoft SQL Server family of databases  LINQ to Entities Will ship as an update to.NET 3.5 Offers a provider model for third-party databases Designed for enterprise-grade data scenarios Higher level of abstraction for programming databases Just one layer of the overall ADO.NET Entity Framework

 Converting LINQ queries to SQL Compiler converts code into a LINQ expression tree LINQ to Entities converts LINQ expression tree into a DbCommandTree based on mapping information  DbCommandTree expressed in terms of the database schema ADO.NET provider generates a DbCommand LINQ to Entities executes the DbCommand, assembles results into the structure(s) specified in the LINQ query

 EntityClient Provider string "SELECT VALUE o FROM NorthwindEntities.Orders AS o " + "WHERE o.Customers.CustomerID = 'ALFKI'"; EntityCommand new EntityCommand(eS EntityDataReader = while ( Console. ("{0} {1:d}", ["OrderID"], ["OrderDate"]);

 Object-relational mapping Records become strongly-typed objects  Data context is the controller mechanism  Facilitates update, delete & insert  Translates LINQ queries behind the scenes  Type, parameter and injection safe

 Instead of manipulating the database directly,developers manipulate the object model,which represents the database  For this,Windows application must be created  Add new LINQ to SQL class items to the project  Drag and drop tables and make changes.It will be saved only in the object model  To save changes in the database use the following syntax  Database.Submitchanges();

 VS 2008 designer or SQLMetal command  Map tables & fields to classes & properties  Generates partial classes with attributes  Each record becomes an object  Data context represents the database  Utilise tables, views or stored procedures

 Update Set object properties  Delete context.Table.DeleteOnSubmit(object)  Insert context.Table.InsertOnSubmit(object)  Commit changes back context.SubmitChanges() Transactional - all or nothing

 Debugging(Complex dedug in SP)  Deployment(.dll)  Type Safety (Errors)

 Extend functionality to an existing class without needing to subclass it  To add extension methods to objects implementing the Ienumerable interface,you need a reference to system.core.dll

Earlier Xpath or Xquery were used to manipulate XML documents, at present LINQ to XML concepts are used Add a reference to the System.xml.linq.dll in the project and also import System.xml.linq namespace Tree -> Xdocument ->XElement ->XAttribute LOAD XDocument LibraryBooks = new Xdocument(); LibraryBooks = Xdocument.load(“Books.xml”);

 Blinq Scaffold web UI for list/view/update pages  PLINQ Parallel query processing over many CPUs  SyncLINQ & Continuous LINQ Updated results via INotifyCollectionChanged

 PLINQ  Microsoft, as a part of the Parallel Extensions, is developing PLINQ, or Parallel LINQ, a parallel execution engine for LINQ queries. It defines the IParallelEnumerable interface. If the source collection implements this interface, the parallel execution engine is invoked. The PLINQ engine executes a query in a distributed manner on a multi-core or multi-processor system. [28]Parallel Extensions paralleldistributed [28]

.NET Framework 3.5  Anonymous types (shaping)  Extension methods (query operators)  Type inference (var keyword)  Lambda expressions (query syntax)