DatasetClass
Indicates the data cache in the memory.
1. dataset is the main component of the ADO. net structure. It is the cache of data retrieved from the data source in the memory.
2. dataset is composed of a group of able objects. You can associate these objects with datarelation objects.
3. dataset can read and write data and architecture as XML documents. Data and architecture can be transmitted over HTTP and used by any application on any platform that supports XMLProgram. You can use the writexmlschema method to save the schema as an XML schema, and use the writexml method to save the schema and data. To read XML documents that contain both the schema and data, use the readxml method.
4. In a typical multi-layer implementation, steps used to create and refresh a dataset and update the original data in sequence include:
1. Use dataadapter to generate and fill each able in dataset with data from the data source.
2. Add, update, or delete a datarow object to change data in a single able object.
3. Call the getchanges method to create the second dataset that only reflects the changes made to the data.
4. Call the update method of dataadapter and pass the second dataset as a parameter.
5 call the merge method to merge the changes in the second dataset into the first one.
6. Call acceptchanges for dataset. Alternatively, call rejectchanges to cancel the change.
DatatableClass
Indicates a table of data in the memory.
-To Add rows to a able, you must use the newrow method to return a new datarow object.
DatacolumnClass
The structure of columns in the able.
-- Datacolumn is the basic construction block used to create the datatable architecture. You can add one or more datacolumn objects to datacolumncollection to generate this architecture.
-Each datacolumn has the ype attribute, which determines the type of data contained in datacolumn. For example, the data type can be limited to integer, string, or decimal. Because the data contained in a able is usually merged back to its original data source, the data type must match the data type in the data source.
DatarowClass
Indicates a row of data in the datatable.
-- Datarow and datacolumn objects are the main components of datatable.
-Use the datarow object and its attributes and methods to retrieve, evaluate, insert, delete, and update values in the datatable.
-- To create a new datarow, use the newrow method of the able object.
-- After creating a new datarow, use the add method to add the new datarow to the datarowcollection.
-- Call the acceptchanges method of the datatable object to confirm whether the data has been added.
-You can call the Remove Method of datarowcollection or call the delete method of the datarow object to delete datarow from datarowcollection.
DatarowcollectionClass
Indicates the set of rows of the datatable.
-- Datarowcollection is the main component of datatable.
-- When datacolumncollection defines the schema of a table, datarowcollection contains the actual data of the table. In this table, each datarow in datarowcollection represents a single row.
-You can call the add and remove methods to insert and delete a datarow object from datarowcollection.
-You can also call the find method to search for a datarow object that contains a specific value in the primary key column, or call the contains method to search for a single word or phrase in character-based data.
DatacolumncollectionClass
Indicates the set of datacolumn objects of datatable.
-Datacolumncollection defines the datatable architecture and determines the types of data that each datacolumn can contain.
-You can access datacolumncollection through the columns attribute of the datatable object.
-- Datacolumncollection inserts and deletes a datacolumn object using the add and remove methods.
-- Use the Count attribute to determine the number of datacolumn objects in the set.
-- Use the contains method to verify whether the specified index or column name exists in the set.
Datatable. newrowMethod
Create a new datarow with the same architecture as this table.
-- Return Value
Type: system. Data. datarow
Return to datarow. Its architecture is the same as that of datatable.
-Remarks
-You must use the newrow method to create a new datarow object with the same architecture as the datatable.
-After datarow is created, you can add it to datarowcollection through the rows attribute of the datatable object.
-To use newrow to create a new row, you must first process the rows and then call clear.
Datatable. RowsAttribute
Obtains the set of rows that belong to the table.
-To create a new datarow, you must use the newrow method to return the new object. Such objects are automatically configured according to the schema. The schema is defined for the datatable through the collection of datacolumn objects.
-After creating a new row and setting values for each column in the row, add the row to datarowcollection using the add method.
-- Each datarow in the Set indicates a row of data in the table. To change the value of a column in a row, you must call the acceptchanges method.
Datatable. ClearMethod
Clear the datatable of all data.
-- All rows in all tables are removed. If the table has any forced child relationship that will isolate the child rows, an exception is generated.
-If dataset is bound to xmldatadocument, calling dataset...:. Clear or datatable...:. Clear will cause notsupportedexception. To avoid this situation, traverse each table and remove each row one by one. To use newrow to create a new row, you must first process the rows and then call clear.