LINQ to SQL is one of the most widely used implementation of LINQ. It is so common that many developers completely overlooked other implementations of LINQ such as LINQ to DataSet or LINQ to Objects. Although LINQ to SQL is only available for SQL Server databases but it is still using all the features available in the other LINQ implementations. In this tutorial, I will give you brief introduction of LINQ to SQL, DataContext object, Entity classes and Object Relational Designer along with some simple LINQ to SQL queries.
In my first tutorial on LINQ, I have given you the overview of LINQ architecture, the query syntax and the Query Operators we use to build LINQ queries. In this tutorial you will learn one more important concept of LINQ called deferred query evaluation and I will explain you why it is important for writing high performance LINQ queries. I will also cover many deferred query operators available in LINQ.
If you are developing .NET applications from some time, you may already know how to connect databases and performs operations using either hard coded SQL queries or stored procedures. You may also know how to query the in memory collection of objects using traditional programming constructs such as loops and conditions. In this tutorial, I will give you introduction to Microsoft’s new technology called LINQ that enables you to integrate query processing features into your programming language such as C# or Visual Basic. More specifically I will show you how you can query in memory object collections or Arrays using some basic LINQ query operators.