advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Download the Code for this Article
Partners & Affiliates
advertisement
advertisement
Rate this item | 0 users have rated this item.
 Print Print
 
ADO.NET vNext Part 3: Querying with LINQ
LINQ provides a straightforward yet expressive SQL-like syntax with which you can query an Entity Data Model and uses anonymous types to return strongly-typed results. 

advertisement
he previous article in this series introduced the core concepts of Object Services Layer, including the steps to perform CRUD (Create, Read, Update and Delete) operations against the Entity Data Model (EDM). With that foundation, this installment focuses on using LINQ to query the EDM. Specifically, this article focuses on the expressive query capabilities of LINQ in querying the EDM through the object services layer. By using LINQ on top of the EDM, you can perform operations such as sorting, joining multiple tables, projecting result sets and so on.


 
Figure 1. Using LINQ on top of ADO.NET Object Services Layer: The figure shows the role of the LINQ framework in the overall architecture of ADO.NET vNext.
Figure 1 shows how client applications can work with the object services layer either through LINQ or Entity SQL.


Using LINQ vs. Entity SQL
If you are using the map provider to connect to the database, the only way you can execute queries is through Entity SQL. However when using the object services layer, you can use either Entity SQL or LINQ to work with the object services layer as shown in Figure 1. So when should you use LINQ as opposed to Entity SQL? The answer depends on your requirements. For example, if you need to construct and execute queries dynamically, Entity SQL will fit the bill. Otherwise, LINQ might be a better choice because its strongly typed nature provides you with compile-time checking and Intelliesense. Note that LINQ and Entity SQL are not mutually exclusive and you can seamlessly mix-and-match LINQ and Entity SQL with no restrictions.

What You Need
To follow along with this article series, you need:


  Next Page: Retrieving Data using LINQ


Page 1: IntroductionPage 3: Using Anonymous Types to Retrieve Data
Page 2: Retrieving Data using LINQ 
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM eBook: Planning a Service Oriented Architecture
IBM eBook: Choosing the Right Architecture--What It Means for You and Your Business
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Avaya Article: Using Intelligent Presence to Create Smarter Business Applications
Intel Go Parallel Article: Getting Started with TBB on Windows
Microsoft Article: 7.0, Microsoft's Lucky Version?
Avaya Article: How to Feed Data into the Avaya Event Processor
IBM Article: Developing a Software Policy for Your Organization
Microsoft Article: Managing Virtual Machines with Microsoft System Center
Intel Go Parallel Article: Intel Threading Tools and OpenMP
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Silverlight 2 App and Walkthrough: Leverage Silverlight 2 with SQL Server and XML
IBM Article: Enterprise Search--Do You Know What's Out There?
HP Demo: StorageWorks EVA4400
Microsoft Article: The Progress and Promise of Deep Zoom
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES