What Is LINQ to SQL
Posted by Tihomir Ivanov on 20 October 2008 03:56
Rating: 5.00
Prior to answering this question, you must first understand what LINQ is. LINQ stands for the
.NET Language Integrated Query and is a new framework extension in .NET 3.5. As the name
suggests, LINQ is a language construct that enables the user to write data access queries natively in
.NET languages.
In days of yore, you had to write inline T-SQL or use a third-party tool to be able to write
queries in your .NET code. With LINQ, your inline queries natively use the metadata from your
project, so you have syntax checking, IntelliSense, and type-checking functionality. In addition,
you also benefit from a single declarative language construct for all your data sources (for
example, XML or a database). LINQ defines a set of standard query operators that allow your
queries to be applied to any IEnumerable<T> interface.
LINQ is the foundation for many native substructures in .NET that enable you to query
disparate data sources. For example, LINQ to XML gives you the ability to write LINQ to query
XML stores; LINQ to DataSets allows you to use DataSets as your data source; LINQ to Objects
provides you with the means to query over collections of objects; and, finally, LINQ to SQL
gives you the ability to work with relational databases.
LTS is the focus of the current and next few chapters and is Microsoft’s first attempt at
ORM. LTS allows you to model a database and gives you the ability to query the database by
using native .NET classes, such as LINQ. Additionally, LTS supports transactional processing,
views, and stored procedures, and provides a centralized structure for business validation.
Good Article.