Đang chuẩn bị liên kết để tải về tài liệu:
Hướng dẫn học Microsoft SQL Server 2008 part 83

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Trong một truy vấn LINQ, các khoản đầu tiên là các khoản từ, xác định nguồn gốc của dữ liệu, và nó phải kết thúc với một điều khoản hoặc SELECT, khoản một GROUP. Các khoản đầu tiên, được gọi là một máy phát điện, xác định nơi dữ liệu sẽ được phát ra từ khi truy vấn được thực hiện. | PartV Data Connectivity 4 WHERE 5 GROUP BY 6 WITH 7 HAVING 10 ORDER BY Notice that the FROM clause is processed first while the SELECT clause is processed almost last. Any clause that is not specified in the query is simply skipped by the query processing engine. This information is important because it points out the similarities between LINQ query syntax and how SQL Server processes a query. r- r - For more information on SQL logical query flow please see Chapter 8 Introducing Basic Query Flow. In a LINQ query the first clause is the FROM clause which specifies the source of the data and it must end with either a SELECT clause or a GROUP clause. The first clause called a generator defines where the data will be coming from when the query is executed. It also specifies the range variable that is used as a reference for each element in the data source. For example the following uses LINQ to return a list of the directories in the root of a hard drive Directoryinfo di new DirectoryINfo C var query from dir in di.GetDirectories order by di.Name select new dir.Name foreach var item in query Console.WriteLine item.Name In this example the first statement creates a new instance of the Directoryinfo class. This is what is used to retrieve a list of the directories. The second statement is the LINQ statement. The variable var is the query variable. This variable does not store actual result data. The results are produced during the iteration of the query which is done in the foreach loop. When the foreach statement executes the query results are returned during each iteration in the variable item. Whereas the LINQ query and the T-SQL query are executed similarly the T-SQL query syntax is a bit different. In T-SQL the query would be executed internally following the steps described earlier. With LINQ the query does not need to go through the rewriting process. In the next example the LINQ query uses the same syntax to query data from the Contact table in the AdventureWorks

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.