Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
ASP.NET 4 Unleased - p 99
Đang chuẩn bị liên kết để tải về tài liệu:
ASP.NET 4 Unleased - p 99
Hải Quân
131
10
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Lưu trữ-Chỉ ra một trường hợp giá trị tài sản được lưu trữ. . UpdateCheck-Chỉ có tài sản tham gia vào những so sánh tương tranh lạc quan. Thuộc tính bảng hỗ trợ các tài sản sau đây duy nhất:. Tên-Chỉ ra tên của bảng cơ sở dữ liệu tương ứng với lớp. Một số ý kiến về những thuộc tính này là cần thiết. | 954 CHAPTER 20 Data Access with LINQ to SQL Storage Indicates a field where the value of the property is stored. UpdateCheck Indicates whether the property participates in optimistic concurrency comparisons. The Table attribute supports the following single property Name Indicates the name of the database table that corresponds to the class. Some comments about these attributes are needed. First you don t need to specify a Name property when your property or class name corresponds to your database column or table name. If on the other hand your database table were named Movies and your class were named Movie you would need to supply the Name property for the Table attribute to map the correct table to the class. Second you always want to specify the primary key column by using the IsPrimaryKey property. For example if you don t specify a primary key column you can t do updates against your database using LINQ. Finally even though we didn t do this in our Movie class you almost always want to include a timestamp column in your database table and indicate the timestamp column by using the IsVersion property. If you don t do this LINQ to SQL checks whether the values of all the properties match the values of all the columns before performing an update command to prevent concurrency conflicts. If you specify a version property LINQ to SQL can check the value of this single property against the database rather than all the columns. Now that we ve created an entity we can start performing queries against the database using LINQ to SQL. For example the page in Listing 20.12 contains a form that enables you to search for movies by a particular director. LISTING 20.12 Entities SearchMovies.aspx @ Page Language C @ Import Namespace System.Web.Configuration @ Import Namespace System.Linq @ Import Namespace System.Data.Linq DOCTYPE html PUBLIC - W3C DTD XHTML 1.0 Transitional EN http www.w3.org TR xhtml1 DTD xhtml1-transitional.dtd script runat server protected void .
TÀI LIỆU LIÊN QUAN
crossorigin="anonymous">
Đã 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.