Microsoft SQL Server 2005 Developer’s Guide- P10
Số trang: 20
Loại file: pdf
Dung lượng: 270.99 KB
Lượt xem: 15
Lượt tải: 0
Xem trước 2 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Microsoft SQL Server 2005 Developer’s Guide- P10:This book is the successor to the SQL Server 2000 Developer’s Guide, whichwas extremely successful thanks to all of the supportive SQL Server developerswho bought that edition of the book. Our first thanks go to all of the peoplewho encouraged us to write another book about Microsoft’s incredible new relationaldatabase server: SQL Server 2005.
Nội dung trích xuất từ tài liệu:
Microsoft SQL Server 2005 Developer’s Guide- P10 Chapter 6: Developing Database Applications with ADO.NET 179 DataSet DataTable DataColumn DataConstraint DataRow DataRelationCollection DataTable DataTable DataColumn DataColumn DataConstraint DataConstraint DataViewFigure 6-2 The DataSet architecture When changes are made to the data contained in a DataTable object, theColumnChanging, ColumnChanged, RowChanging, and RowChanged eventsare fired. When data is deleted from a DataTable object, the RowDeleting andRowDeleted events are fired. New rows are added to a DataTable by calling theDataTable’s NewRow method and passing it a DataRow object. The maximumnumber of rows that can be stored in a DataTable is 16,777,216. The DataTableis also used as a basis to create DataView objects.DataColumnThe DataColumn class is located in the .NET Framework at System.Data.DataColumn.The DataColumn class represents the schema of a column in a DataTable object. TheDataColumn class contains several properties that are used to define the type of datacontained in the DataColumn object. For example, the DataType property controlsthe type of data that can be stored in the DataColumn object, the DataValue propertycontains the DataColumn’s value, the AllowDBNull property specifies whether theDataColumn can contain NULL values, the MaxLength property sets the maximumlength of a Text DataType, and the Table property specifies the DataTable object that180 M i c r o s o f t S Q L S e r v e r 2 0 0 5 D e v e l o p e r ’s G u i d e the DataColumn belongs to. DataColumns can be made to contain unique values by associating a UniqueConstraint object with the DataColumn object. In addition, you can relate a DataColumn object to another DataColumn object by creating a DataRelation object and adding it to the DataSet’s DataRelationCollection. DataRow Found in the .NET Framework at System.Data.DataRow, the DataRow class represents a row of data in the DataTable object. The DataRow class and the DataColumn class represent the primary objects that make up the DataTable class. The DataRow object is used to insert, update, and delete rows from a DataTable. Rows can be added to a DataTable by either creating a new DataRow object using the NewRow method or by Adding a DataRow object to the DataSet’s DataRowCollection. DataRow objects are updated by simply changing the DataRow object’s DataValue property. You delete a DataRow object by executing the DataRow object’s Delete method or by calling the DataSet’s DataRowCollection object’s Remove method. DataView Found in the .NET Framework at System.Data.DataView, the DataView class offers a customized view of a subset of rows in a DataTable object. Like the DataTable object, DataView objects can be bound to both WinForm and WebForm controls. The DataView classes’s RowFilter and Sort properties can allow the data presented by the DataView to be displayed in a different order than the data presented by the base DataTable object. Like the DataTable object, the data contained in a DataView object is updatable. You can add new rows by using the AddNew method, and you can delete rows by using the Delete method. DataViewManager The DataViewManager class is located in the .NET Framework at SystemData.Data- ViewManager. The DataViewManager class is a bit different than the other classes in the System.Data namespace. Essentially, the DataViewManager class tracks the Data- ViewSetting objects for each DataTable in the DataSet in its DataViewSettingsCollec- tion. The DataViewSettingsCollection is a group of DataViewSetting objects where each DataViewSetting object contains properties like the RowFilter, RowStateFilter, and Sort that define each DataView object. Chapter 6: Developing Database Applications with ADO.NET 181DataRelationThe DataRelation class is located in the .NET Framework at System.Data.DataRelation. The DataRelation class is used to represent parent-child relationshipsbetween two DataTable objects contained in a DataSet. For example, you couldcreate a DataRelation object between an OrderID DataColumn in an Order Headertable to the corresponding OrderID DataColumn in an Order Detail table. The basicfunction of the DataRelation object is to facilitate navigation and data retrievalfrom related DataTables. In order to create a relationship between two DataTableobjects, the two DataTables must contain DataColumn objects that have matchingattributes. When a DataRelation is first created, the .NET Framework checks tomake sure that the relationship is valid and then adds the DataRelation object to theDataRelationCollection, which tracks all of the data relations for the DataSet. TheDataRelation class supports cascading changes from the parent table to the childtable, and this is controlled through the ForeignKeyConstraint class.ConstraintFound in the .NET Framework at System.Data.Constraint, the Constraint classrepresents a set of data integrity rules that can be applied to a DataColumn object.There is no base constructor for the Constraint class. Instead, constraint objects arecreated using either the ForeignKeyConstraint constructor or the UniqueConstraintconstructor.ForeignKeyConstraintThe ForeignKeyConstraint clas ...
Nội dung trích xuất từ tài liệu:
Microsoft SQL Server 2005 Developer’s Guide- P10 Chapter 6: Developing Database Applications with ADO.NET 179 DataSet DataTable DataColumn DataConstraint DataRow DataRelationCollection DataTable DataTable DataColumn DataColumn DataConstraint DataConstraint DataViewFigure 6-2 The DataSet architecture When changes are made to the data contained in a DataTable object, theColumnChanging, ColumnChanged, RowChanging, and RowChanged eventsare fired. When data is deleted from a DataTable object, the RowDeleting andRowDeleted events are fired. New rows are added to a DataTable by calling theDataTable’s NewRow method and passing it a DataRow object. The maximumnumber of rows that can be stored in a DataTable is 16,777,216. The DataTableis also used as a basis to create DataView objects.DataColumnThe DataColumn class is located in the .NET Framework at System.Data.DataColumn.The DataColumn class represents the schema of a column in a DataTable object. TheDataColumn class contains several properties that are used to define the type of datacontained in the DataColumn object. For example, the DataType property controlsthe type of data that can be stored in the DataColumn object, the DataValue propertycontains the DataColumn’s value, the AllowDBNull property specifies whether theDataColumn can contain NULL values, the MaxLength property sets the maximumlength of a Text DataType, and the Table property specifies the DataTable object that180 M i c r o s o f t S Q L S e r v e r 2 0 0 5 D e v e l o p e r ’s G u i d e the DataColumn belongs to. DataColumns can be made to contain unique values by associating a UniqueConstraint object with the DataColumn object. In addition, you can relate a DataColumn object to another DataColumn object by creating a DataRelation object and adding it to the DataSet’s DataRelationCollection. DataRow Found in the .NET Framework at System.Data.DataRow, the DataRow class represents a row of data in the DataTable object. The DataRow class and the DataColumn class represent the primary objects that make up the DataTable class. The DataRow object is used to insert, update, and delete rows from a DataTable. Rows can be added to a DataTable by either creating a new DataRow object using the NewRow method or by Adding a DataRow object to the DataSet’s DataRowCollection. DataRow objects are updated by simply changing the DataRow object’s DataValue property. You delete a DataRow object by executing the DataRow object’s Delete method or by calling the DataSet’s DataRowCollection object’s Remove method. DataView Found in the .NET Framework at System.Data.DataView, the DataView class offers a customized view of a subset of rows in a DataTable object. Like the DataTable object, DataView objects can be bound to both WinForm and WebForm controls. The DataView classes’s RowFilter and Sort properties can allow the data presented by the DataView to be displayed in a different order than the data presented by the base DataTable object. Like the DataTable object, the data contained in a DataView object is updatable. You can add new rows by using the AddNew method, and you can delete rows by using the Delete method. DataViewManager The DataViewManager class is located in the .NET Framework at SystemData.Data- ViewManager. The DataViewManager class is a bit different than the other classes in the System.Data namespace. Essentially, the DataViewManager class tracks the Data- ViewSetting objects for each DataTable in the DataSet in its DataViewSettingsCollec- tion. The DataViewSettingsCollection is a group of DataViewSetting objects where each DataViewSetting object contains properties like the RowFilter, RowStateFilter, and Sort that define each DataView object. Chapter 6: Developing Database Applications with ADO.NET 181DataRelationThe DataRelation class is located in the .NET Framework at System.Data.DataRelation. The DataRelation class is used to represent parent-child relationshipsbetween two DataTable objects contained in a DataSet. For example, you couldcreate a DataRelation object between an OrderID DataColumn in an Order Headertable to the corresponding OrderID DataColumn in an Order Detail table. The basicfunction of the DataRelation object is to facilitate navigation and data retrievalfrom related DataTables. In order to create a relationship between two DataTableobjects, the two DataTables must contain DataColumn objects that have matchingattributes. When a DataRelation is first created, the .NET Framework checks tomake sure that the relationship is valid and then adds the DataRelation object to theDataRelationCollection, which tracks all of the data relations for the DataSet. TheDataRelation class supports cascading changes from the parent table to the childtable, and this is controlled through the ForeignKeyConstraint class.ConstraintFound in the .NET Framework at System.Data.Constraint, the Constraint classrepresents a set of data integrity rules that can be applied to a DataColumn object.There is no base constructor for the Constraint class. Instead, constraint objects arecreated using either the ForeignKeyConstraint constructor or the UniqueConstraintconstructor.ForeignKeyConstraintThe ForeignKeyConstraint clas ...
Tìm kiếm theo từ khóa liên quan:
giáo trình cơ sở dữ liệu quản trị cơ sở dữ liệu MySQL cơ bản bảo mật cơ sở dữ liệu giáo trình sql cơ bảnTài liệu có liên quan:
-
62 trang 422 3 0
-
Giáo trình Cơ sở dữ liệu: Phần 2 - TS. Nguyễn Hoàng Sơn
158 trang 319 0 0 -
Đề cương chi tiết học phần Quản trị cơ sở dữ liệu (Database Management Systems - DBMS)
14 trang 254 0 0 -
Giáo trình Cơ sở dữ liệu: Phần 2 - Đại học Kinh tế TP. HCM
115 trang 188 0 0 -
Giáo trình Cơ sở dữ liệu: Phần 1 - Sở Bưu chính Viễn Thông TP Hà Nội
48 trang 187 1 0 -
Giáo Trình về Cơ Sở Dữ Liệu - Phan Tấn Quốc
114 trang 132 1 0 -
Giáo trình Cơ sở dữ liệu (Ngành: Công nghệ thông tin - Trung cấp) - Trường Cao đẳng Xây dựng số 1
49 trang 113 0 0 -
Giáo trình cơ sở dữ liệu quan hệ_3
26 trang 110 0 0 -
Tiểu Luận Chương Trình Quản Lí Học Phí Trường THPT
18 trang 104 0 0 -
Giáo trình: Hệ quản trị cơ sở dữ liệu - Nguyễn Trần Quốc Vinh
217 trang 89 0 0