Explain the basic use of “DataView” and explain its methods.A DataView is a representation of a full table or a small section of rows. It is used to sort and find data within Datatable.
Following are the methods of a DataView:
Find : Parameter: An array of values; Value Returned: Index of the row.
FindRow : Parameter: An array of values; Value Returned: Collection of DataRow.
AddNew : Adds a new row to the DataView object.
Delete : Deletes the specified row from DataView object. Explain the basic use of “DataView” and explain its methods.It is a customizable view of a datatable that allows filtering, searching, editing, navigation.
DataView method:
1. AddNew: To add a new row to the DataView.
2. BeginInit: Begins the initialization of a DataView.
3. CopyTo: items are copied into an array.
4. Delete: Used to delete a row at the specified position.
5. Dispose: Releases the resources.
6. EndInit: Ends the initialization of a DataView.
7. Equals: Compares object instances are equal or not.
8. Find: Finds a specific row in the DataView.
9. FindRows: Returns an array of DataRowView
10. GetEnumerator: Gets an enumerator.
11. GetHashCode: it is used in hashing algorithms.
12. GetService : fetches the implementer of the IServiceProvider.
13. GetType : fetches the current instance type.
14. ToString : Returns a String.
15. Close: Used to close a DataView.
16. ColumnCollectionChanged: Occurs after a DataColumnCollection is successfully changed
17. Dispose: can be overloaded
18. Finalize: Used to free resources and cleanup before objects are handeled by garbage collection.
19. IndexListChanged: This event tab=kes place when DataView has been changed successfully.
20. MemberwiseClone : Creates a shallow copy.
21. OnListChanged: Raises the ListChanged event.
22. Open: To open a DataView.
|