TAILIEUCHUNG - Microsoft ADO .NET 4 Step by Step - p 34

Về phía DataRow, một lĩnh vực mới (của T) phương pháp di chuyển mỗi giá trị của cột dữ liệu từ một cuộc sống chung typeless bán, với sự hiện diện mạnh mẽ gõ trong các truy vấn của bạn. | On the DataRow side a new Field Of T method moves each data column value from a generic semi-typeless existence to a strongly typed presence within your queries. It is still up to you as the programmer to correctly indicate the type of each field as you add them to the LINQ query syntax. But once defined you can apply all the standard operators to those fields including them in projections filters and other types of expressions. Note You can use DataRow values within LINQ queries without applying the Field Of T extension method. However these fields will still pose as instances. This might prevent you from carrying out certain types of query actions on specific fields. Also you must still resolve the data type of each field before using it in post-query processing. LINQ to DataSet also lets you craft queries that use Typed Data Sets however the Entity Framework supercedes most of the advantages of typed data sets. Therefore LINQ queries against typed data sets are not discussed in this book. Writing Queries with LINQ to DataSet With the exception of the new enumerated methods specific to LINQ to DataSet using DataTable objects in LINQ queries is identical to using standard collection objects. The first step involves converting a data table to its enumerable equivalent using the and which can be applied to any DataTable instance. C ---- Customer is an existing DataTable instance. var results from cu in select cu Visual Basic ----- Customer is an existing DataTable instance. Dim results From cu In Select cu Although the LINQ to DataSet provider includes DataSet in its name the focus in LINQ queries is on the DataTable class. LINQ to DataSet does not consider a DataTable instance s presence in an overall DataSet to be significant nor does it examine any DataRelationship objects when processing queries that contain multiple DataTable instances. You must link tables together using LINQ s standard

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.