background preloader

LINQ to SQL

Facebook Twitter

Поддержка отладки (LINQ to SQL)

Advice

Внесение и отправка изменений данных (LINQ to SQL) Обучение с помощью пошаговых руководств (LINQ to SQL) Операции в LINQ to SQL с примерами. // Northwnd inherits from System.Data.Linq.DataContext. Northwnd nw = new Northwnd(@"northwnd.mdf"); // or, if you are not using SQL Server Express// Northwnd nw = new Northwnd("Database=Northwind;Server=server_name;Integrated Security=SSPI"); var companyNameQuery = from cust in nw.Customers where cust.City == "London" select cust.CompanyName; foreach (var customer in companyNameQuery) { Console.WriteLine(customer); } // Northwnd inherits from System.Data.Linq.DataContext. Northwnd nw = new Northwnd(@"northwnd.mdf"); Customer cust = new Customer(); cust.CompanyName = "SomeCompany"; cust.City = "London"; cust.CustomerID = "98128"; cust.PostalCode = "55555"; cust.Phone = "555-555-5555"; nw.Customers.InsertOnSubmit(cust); // At this point, the new Customer object is added in the object model.// In LINQ to SQL, the change is not sent to the database until// SubmitChanges is called. nw.SubmitChanges(); Основные понятия Другие ресурсы.

LINQ to SQL: Guide on English. MSDN Library Articles and Overviews .NET General LINQ: .NET Language Integrated Query LINQ to SQL: .NET Language-Integrated Query for Relational Data .NET Language-Integrated Query for XML Data The .NET Standard Query Operators Overview of C# 3.0 LINQ to SQL: .NET Language-Integrated Query for Relational Data 398 out of 514 rated this helpful - Rate this topic Dinesh Kulkarni, Luca Bolognese, Matt Warren, Anders Hejlsberg, Kit George March 2007 Applies to: Visual Studio Code Name "Orcas" .Net Framework 3.5 Summary: LINQ to SQL provides a runtime infrastructure for managing relational data as objects without losing the ability to query. Contents Introduction Most programs written today manipulate data in one way or another and often this data is stored in a relational database. Of course, the differences go far deeper than that.

It is no wonder that applications expected to bridge this gap are difficult to build and maintain. LINQ to SQL is designed to be non-intrusive to your application.