c# - New DataView vs. DefaultView of a DataTable -
why construct new dataview
instead of using defaultview
of datatable
in c#?
what scenarios creating new dataview
preferable?
what advantages , disadvantages of both?
var dataview = new dataview(datatable);
vs
var dataview = datatable.defaultview;
the defaultview has advantage of being there default, name implies.
additional dataviews have advantage of allowing keep several of them ready , in use in parallel.
so can filter , sort 3 of them in different ways , bind 3 different controls, e.g. three datagridviews
or dgv
, items
of comboboxcell
them independently.
quoting this post:
a dataview view on datatable, bit sql view. allows filter , sort rows - binding windows form control. additionally, dataview can customized present subset of data datatable. capability allows have 2 controls bound same datatable, showing different versions of data.
Comments
Post a Comment