Posts

Showing posts from June, 2010

What You Can Do With LINQ to SQL

Image
LINQ to SQL supports all the key capabilities you would expect as a SQL developer. You can query for information, and insert, update, and delete information from tables. Selecting Selecting ( projection ) is achieved by just writing a LINQ query in your own programming language, and then executing that query to retrieve the results. LINQ to SQL itself translates all the necessary operations into the necessary SQL operations that you are familiar with. For more information, In the following example, the company names of customers from London are retrieved and displayed in the console window. Visual Basic ' Northwnd inherits from System.Data.Linq.DataContext. Dim nw As New Northwnd( "c:\northwnd.mdf" ) Dim companyNameQuery = _ From cust In nw.Customers _ Where cust.City = "London" _ Select cust.CompanyName For Each customer In companyNameQuery Console.WriteLine(customer) Next C# // Northwnd inherits from System.Data.Lin...