TAILIEUCHUNG - Professional LINQ phần 8

và hiệu quả xây dựng một tài liệu XML trong một tuyên bố duy nhất. Sau đó, bạn thấy làm thế nào để thêm chú thích cho các phần tử và các thuộc tính trong một cây XML bằng cách sử dụng phương pháp AddAnnotation, và làm thế nào để đọc các chú thích một khi họ | Chapter 13 More about Entity Classes To see how this works fire up Visual Studio create a new Windows project and add the appropriate references Next view the code behind Forml and add the following statements using using Prior to Beta2 attribute-based mapping was supported via the namespace. If you then installed Beta2 and tried to compile your code you received a lot of compile errors. That is because attribute-based mapping is now supported via the namespace. Next underneath the partial class of Forml add the following highlighted code namespace LINQ public partial class Form1 Form public Forml InitializeComponent private void Form1_Load object sender EventArgs e public class AdventureWorks DataContext public AdventureWorks string connection base connection public Table Contact Contacts Table Name public class Contact Column DbType int not null IsPrimaryKey true IsDbGenerated true public int ContactID Column DbType nvarchar 8 not null public string Title Column DbType nvarchar 50 not null public string FirstName Column DbType nvarchar 50 not null public string MiddleName 259 Part III LINQtoSQL Column DbType nvarchar 50 not null public string LastName Column DbType nvarchar 50 not null public string EmailAddress Column DbType int public int EmailPromotion Column DbType bit public byte NameStyle Column DbType varchar 40 public string PasswordHash Column DbType varchar 40 public string PasswordSalt The rest of this code should look familiar you have seen it throughout the last few chapters. Attributebased mapping is used to map a SQL Server database and table to a LINQ to SQL class. For purposes of this example create a small routine that will do a lot of the work for you. Add the following code after the Load event of Form1. The code will be explained shortly. private void InsertNames string firstName string title string emailAddr AdventureWorks db .

TỪ KHÓA LIÊN QUAN
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.