Data View and Dataset

DataSet holds DataTables (like a database), DataView is a view for a DataTable which can control how the underlying DataTable can be viewed by restricting columns, etc. In a database views are usually used to both increase performance and also restrict access to certain columns, while in .NET via code they can be used to restrict access to certain columns as well, but also gives more flexibility on how you can present data (as far as I know they dont give any performance increase via code).
 
i see
so basically, data view is just to define the settings for how data is to be viewed?
whereas data set actually holds the data which can be manipulated?
 
A DataView is nothing by itself - it does not contain ANY data. It MUST be hooked to a DataTable to have any data. You can think of a DataView as an array of pointers into a DataTable. The array can be filtered and sorted as well (the primary use for a DataView).

You can also set some properties such as AllowNew, AllowDelete, etc. This is how you control whether new rows can be added or deleted from a DataTable when binding to a DataGrid.

-Nerseus
 
Back
Top