Saturday, July 21, 2007

ADO.net DataReader Basics Methods and Properties

The DataReader provides an unbuffered stream of data that allows procedural logic to efficiently process results from a data source sequentially
Good choice when working with a large amount of data
DataReader must be closed if Command object returns value
If multiple sets are returned, the DataReader provides the NextResult to iterate

Important Methods/Properties of DataReader Class:
Public Properties:
1. Relations: Get the collection of relations that link tables
2. Tables: Get the collection of tables in the dataset
3. IsInitialized : Gets a value that indicates whether the dataset is initialized

Public Methods:
1. AcceptChanges : Commit all changes since last upload or AcceptChanges call
2. Clear : Clear all rows of in the dataset
3. Equals : Determine if two objects are similar
4. GetXML : Get XML representation of data in the dataset
5. RejectChanges: Rollback changes made since last upload or AcceptChanges call

No comments: