PC Review


Reply
 
 
Sahil Malik [MVP]
Guest
Posts: n/a
 
      13th Jun 2005
DataView shows you a subset of a DataTable's data based upon a specified
condition/filter
DataView is a brand new object that holds references to only relevant
DataTable rows and the datatable itself.

- Sahil Malik [MVP]
Upcoming ADO.NET 2.0 book - http://tinyurl.com/9bync
----------------------------------------------------------------------------
---------------

"Manida Jones" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> What's the difference between using a data table or a dataview to view
> records?
>
>



 
Reply With Quote
 
 
 
 
Manida Jones
Guest
Posts: n/a
 
      13th Jun 2005
What's the difference between using a data table or a dataview to view
records?


 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      13th Jun 2005
Manida,

A dataview can be the in the datatable integrated defaultview or a new
representant of that called new dataview.

It holds information about which part of a datatable should be used (viewed)
by a rowfilter, and in which sequence it will be used (viewed) by the sort
property. As well has it some methods, by instance to find rows based on the
sort information.

I hope this helps,

Cor


 
Reply With Quote
 
W.G. Ryan eMVP
Guest
Posts: n/a
 
      13th Jun 2005
In addition to Cor and Sahil - the 'difference' depends on who's point of
view you're looking from. The DataView is built on a DataTable like they
both mention. As such, from a User's point of view, there's NO difference.
There'd be absolutely no way, short of using Reflector or asking the
developer, for someone to tell that you bound something to a DataView vs a
DataTable or that any given data is in a DataView vs. DataTable.

I use views a lot more than tables when i'm displaying data b/c it often
needs sorted. And using the RowFilter to filter data is pretty simple to
employ (although you certainly can slice data with a DataTable.Select for
instance). For Aggregated values, the DataTable has the Compute Method
which lets you grab Sum, Count etc so often I bind to a view for display
purposes, but use Compute to provide summary statistics. When I'm using
NonVisual components, I almost never use a DataVIew b/c sorting isn't
typically necessary (although it certianly could be). So the datatable
gives you compute http://www.knowdotnet.com/articles/expressions.html
(which you can defeinitely mimick using a dataview but it's cleaner using a
DataTable) and DataViews give you sort.

All in all it's mainly a matter of personal preference. My rule of thumb is
that if I'm displyaing the data for the user, I'll bind to a View by
default - otherwise I just use a DataTable unless for some reason I need a
view.

HTH,

Bill

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Manida Jones" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> What's the difference between using a data table or a dataview to view
> records?
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      14th Jun 2005
> All in all it's mainly a matter of personal preference. My rule of thumb
> is that if I'm displyaing the data for the user, I'll bind to a View by
> default - otherwise I just use a DataTable unless for some reason I need a
> view.
>

Right

As I do it to the defaultview in case if it is a complex control and direct
to the datatable if it is a simple control.

Cor


 
Reply With Quote
 
Manida Jones
Guest
Posts: n/a
 
      14th Jun 2005
Thanks!!!! Your explanations helped alot.


"Manida Jones" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> What's the difference between using a data table or a dataview to view
> records?
>



 
Reply With Quote
 
W.G. Ryan eMVP
Guest
Posts: n/a
 
      14th Jun 2005
Good point. I got in the habit of doing it to a view across the board when
it's a UI thing, but you way definintely makes sense.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>> All in all it's mainly a matter of personal preference. My rule of thumb
>> is that if I'm displyaing the data for the user, I'll bind to a View by
>> default - otherwise I just use a DataTable unless for some reason I need
>> a view.
>>

> Right
>
> As I do it to the defaultview in case if it is a complex control and
> direct to the datatable if it is a simple control.
>
> Cor
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:09 PM.