Hooked on LINQ

Hooked on LINQ - Developers' Wiki
for .NET Language Integrated Query

Companion book for this site
LINQ to Objects Using C# 4.0:
Using and Extending LINQ to Objects and Parallel LINQ (PLINQ)
Quick Search

Advanced Search »

LINQ to SQL

Modified: 2009/11/14 14:20 by Cecil - Categorized as: LINQ to SQL

Edit

Introduction

LINQ to SQL allows .NET developers to write “queries” in their .NET language of choice to retrieve and manipulate data from a SQL Server database. In a general sense, LINQ to SQL allows us to create SQL queries in our preferred .NET language syntax and work with a strongly types collection of objects as a return result. We can make changes to these objects then save changes back to the database.

Features at a glance:

  • New API for accessing and working with SQL Server databases
  • Query language over database (eg. Write in C#, functional SQL query generated )
  • Creates strongly typed object wrappers for database objects, including foreign-key hierarchy if they exist. Provides syntax checking and intellisense support in VS.NET
  • Object changes persisted back to the database (dynamic SQL or Stored Procedures)
  • Create databases and tables from objects in code
  • Built-in diagnostics

This technology was codenamed DLINQ when it was initially made public.

Edit

More Information / Related Pages

LINQ to SQL - 5 Minute Overview - Gives you an overview of the LINQ to SQL features through many samples.
SQL Metal - The code generator that reverse engineers a given database and build the required entity types and Data Context layer.
Stored Procedure Optional Parameters using LINQ to SQL - How to alter the generated method signature in LINQ to SQL to drop optional parameters and allows the default supplied in T-SQL to be used.


Batch Updates and Deletes for LINQ to SQL - Terry Aney has posted his solution in the form of a few very cool extension methods that support batch deletes and updates. See the article here.

Edit

Resources

If you would like to comment on this page, click on the Discuss button located on the top-right of each page. Feel free to edit any mistakes or omissions you find. If you have an objection or find in-appropriate content then contact the administrator. This website is not affiliated with Microsoft®, all content and opinions are those of the specific author and some advice, solutions and article may contain unintentional errors - please use care. Other websites by this author: Focused Objective, Geek Speak Decoded.