General overview to .net Data Sets

xiaoxiao2021-03-06  106

The huge mainstream of applications built today involve data manipulation in some way-whether it be retrieval, storage, change, translation, verification, or transportation. For an application to be scalable and allow other apps to interact with it, the app will need a Common Mechanism to Pass the data around.

Ideally, the vehicle that transports the data should contain the base data, any related data and metadata, and should be able to track changes to the data. Here's where the ADO.NET DataSet steps in. The ADO.NET DataSet is a data construct that can contain several relational rowsets, the relations that link those rowsets, and the metadata for each rowset. The DataSet also tracks which fields have changed, their new values ​​and their original values, and can store custom information in its Extended Properties collection. The DataSet Can Be Exported to Xml or create, Thus Enabling Increased Interoperability Between Applications.

When we look at the DataSet object model, we see that it is made up of three collections;. Tables, Relations, and ExtendedProperties These collections make up the relational data structure of the DataSet The DataSet.Tables property is a DataTableCollection object, which. contains zero or more DataTable objects. Each DataTable represents a table of data from the data source. Each DataTable is made p of a Columns collection and a Rows collection, which are zero or more DataColumns or DataRows, in that order.

The Relations property as a DataRelationCollection object, which contains zero or more DataRelation objects. The DataRelation objects define a parent-child relationship between two tables based on foreign key values. On the other hand, The ExtendedProperties property is a PropertyCollection object, which contains zero or more user-defined properties. The ExtendedProperties collection can be used contains zero or more user defined properties. This property collection can be used to store custom data related to the DataSet, such as the time when the DataSet was constructed.One of the key points to remember about the DataSet is that it does not care where it originated. Unlike the ADO 2.x Recordset, the DataSet does not track which database or XML document its data came from. In this way, the DataSet is a standalone Data Store That Can Be Passed from Tier To Tier in An n-tiered architecture. this article Etrieve Data, Track Modifications Made by The User, And Send The Data Back to The Database.

Using C # .NET, we will show how to retrieve products from the Northwind database from a business services application and load the information in the presentation tier, all using .NET. We will walk through examples of how to use the DataSet to save several rows To The Database at One Time. The Code Samples Will Demonstrate How To Send New Rows, Changed Rows, And Deleted Rows in One on to the database by using a dataset.

转载请注明原文地址:https://www.9cbs.com/read-124616.html

New Post(0)