Home > Microsoft .Net Development Tips > .NET Developer > Beginning LINQ development, Part 2
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

.NET DEVELOPER

Beginning LINQ development, Part 2


Brian Eastwood, Site Editor
08.29.2007
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Our previous Beginning LINQ development tip offered an introduction to LINQ to SQL queries and to the use of LINQ in ASP.NET applications.

Much has been written in subsequent months about LINQ, the Language Integrated Query, which as you have probably determined by now is a focal point of Visual Studio 2008 programming. Here we revisit LINQ to SQL basics and also point to tutorials on topics such as monitoring LINQ to SQL performance, building LINQ providers and

Getting up close and personal with LINQ to SQL. Scott Guthrie has become synonymous with "long, in-depth tutorial," and he has been working on a LINQ to SQL series for quite some time now.

  • Part 1, as one would expect, is an introduction to the LINQ to SQL designer inside Visual Studio 2008 and provides a few basic code examples in VB and C#.
  • Part 2 dives into the processes of creating data model classes, using entity classes (which map directly to or from a database), and using stored procedures within LINQ to SQL.
  • Part 3 takes a look at database queries and how they can be modified to return specific subsets of information, all while taking advantage of IntelliSense, refactoring and compilation checking.
  • Part 4 demonstrates how LINQ can be used to insert and delete data in SQL databases and how custom entities can be used to validate both objects and methods.
  • Part 5 looks into data binding for Web applications using a control called asp:LinqDataSource, which binds directly to a LINQ-enabled data model and thus can take advantage of LINQ's object-relational mapping capabilities.
  • Part 6 talks about the use of database stored procedures and the ability to map them to data model classes; also discussed is the process of calling user-defined functions.
  • Part 7 shows how stored procedures can be used to modify SQL databases -- and how this process is not much different that it would be if one were to use dynamic SQL.
  • Last but not least, Part 8 covers the use of custom SQL expressions.

LINQ to SQL performance. Here Rico Mariani built a rather "harsh test environment" in which to test the performance of LINQ to SQL, or queries to a SQL Server database.

  • Part 1 introduces that test environment and reviews the metrics that came up when performance was first monitored.
  • Part 2 discovers the problem -- "It was the per-query costs that seemed to be the greatest trouble spot in the then-current profiles."
  • Part 3 describes how to tweak entity management and data binding within the query
  • Finally, Part 4 provides the code syntax for the new build and demonstrates the performance gains to be found in compiled queries.

Building LINQ providers. Matt Warren has put together a nice three-part series on how to use IQueryable and IQueryProvider to build a LINQ provider, which is a way to make a data source accessible through LINQ.

  • Part 1 introduces the properties of these two public interfaces and offers some basic information on how to implement them.
  • Part 2 demonstrates how to build the LINQ provider so that it will translate the query into SQL command text and translate the result of executing that command into an object.
  • Part 3 extends the LINQ provider to numerous operators that all share complex interactions.

Let's get visual. If staring at paragraphs of text and lines of code gets you down, then the Visual Basic team at Microsoft may have just what the doctor ordered. Among the "How Do I" videos that the development group has posted is a five-part series highlighting Visual Basic 2008 and LINQ. Moreover, there are two videos of interest on Channel 9 -- LINQ to SQL and the O/R Designer in VS 2008 and Visual Basic LINQ Syntax in Visual Studio 2008.

Oh, and one more thing. In case we missed anything, Fabrice Marguerie has compiled a helpful LINQ link list. Try saying that five times fast.


Rate this Tip
To rate tips, you must be a member of SearchWinDevelopment.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
.NET Developer
How to speed up Visual Studio 2008's slow WPF designer
How to list fonts in WPF using markup extensions and data templates
How to convince management to buy Microsoft Visual Studio 2008
Microsoft webcast series previews new Visual Studio 2010 features
New features in Windows 7 bring new UI considerations for developers
User Account Control (UAC): How to develop code for standard users
Introduction to Vista's user account control (UAC) for developers
Visual Studio 2008 code metrics tools will help keep code clean
Downloadable MSDN library released for VS 2008 SP 1
Widgetbox provides good example of how to use Facebook Developer Toolkit

Visual Studio 2008 and Language Integrated Query (LINQ)
LINQ in Visual Studio 2008 addresses object data modeling
LINQ Learning Guide: Third-party LINQ Implementations
LINQ Learning Guide: LINQ to Entities
LINQ Learning Guide: LINQ to SQL
LINQ Learning Guide: LINQ to DataSet
LINQ Learning Guide: LINQ to Objects
LINQ Learning Guide: LINQ Providers
LINQ Learning Guide
LINQ Learning Guide: LINQ and Visual Studio 2008's new language features
LINQ Learning Guide: LINQ and Web applications

.NET Framework 3.5 and Visual Studio 2008 development
Microsoft's message at TechEd: make the most of what you have
How to speed up Visual Studio 2008's slow WPF designer
How to list fonts in WPF using markup extensions and data templates
How to convince management to buy Microsoft Visual Studio 2008
Moonlight 1.0 release brings Silverlight to Linux
Microsoft cuts Visual Studio 2008 upgrade prices as VS 2010 looms
User Account Control (UAC): How to develop code for standard users
How to write installers in Vista that work correctly under UAC
How to elevate programs' privileges correctly using Vista's UAC
Introduction to Vista's user account control (UAC) for developers

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
LINQ  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Database Programming Solutions - .NET XML, Visual Studio LINQ, ORM .NET
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts