TAILIEUCHUNG - Adding Restrictions to DataTable and DataColumn Objects phần 1

Adding Restrictions to DataTable and DataColumn Objects As you know, a DataSet object is used to store a copy of a subset of the database. For example, you can store a copy of the rows from database tables into a DataSet | Adding Restrictions to DataTable and DataColumn Objects As you know a DataSet object is used to store a copy of a subset of the database. For example you can store a copy of the rows from database tables into a DataSet with each table represented by a DataTable object. A DataTable stores columns in DataColumn objects. In addition to storing rows retrieved from a database table you can also add restrictions to a DataTable and its DataColumn objects. This allows you to model the same restrictions placed on the database tables and columns in your DataTable and DataColumn objects. For example you can add the following constraints to a DataTable Unique Primary key Foreign key In addition you can add the following restrictions to a DataColumn Whether the column can accept a null value-which you store in the AllowDBNull property of the DataColumn. Any auto-increment information-which you store in the AutoIncrement AutoIncrementSeed and AutoIncrementStep properties of the DataColumn. You set these properties when adding rows to a DataTable with a corresponding database table that contains an identity column. The ProductID column of the Products table is an example of an identity column. Note will not automatically generate values for identity columns in a new row. Only the database can do that. You must read the generated identity value for the column from the database. You ll see how to do that later in the sections Retrieving New Identity Column Values and Using Stored Procedures to Add Modify and Remove Rows from the Database. Also if your database table contains columns that are assigned a default value you should read that value from the database. This is better than setting the DefaultValue property of a DataColumn because if the default value set in the database table definition changes you can pick up the new value from the database rather than having to change your code. The maximum length of a string or character column value-which you store in the .

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.