469,336 Members | 5,271 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

DataTable vs DataView

I'm new to VB.NET and just gettng into database "Learning." How do I decide
if I need a DataTable or a DataView.

Thanks...

Bruce
Nov 21 '05 #1
4 14882
Hi,

A dataview is a customized view of a datatable that supports
filtering, sorting, and searching.

http://msdn.microsoft.com/library/de...classtopic.asp
Ken
---------------------
"Bruce A. Julseth" <br***********@attglobal.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I'm new to VB.NET and just gettng into database "Learning." How do I decide
if I need a DataTable or a DataView.

Thanks...

Bruce

Nov 21 '05 #2

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:eq**************@tk2msftngp13.phx.gbl...
Hi,

A dataview is a customized view of a datatable that supports
filtering, sorting, and searching.

http://msdn.microsoft.com/library/de...classtopic.asp

Ken
---------------------
"Bruce A. Julseth" <br***********@attglobal.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I'm new to VB.NET and just gettng into database "Learning." How do I decide if I need a DataTable or a DataView.

Thanks...

Bruce


So, if I'm using a datagrid and only want to display and edit the data, I
use a DataTable which I created from my DataAdaptor. If I want to filter,
sort or search my data, I need to use a DataView.

Is my understanding correct?

Bruce
Nov 21 '05 #3
Bruce,

When you use a windowforms datagrid you can better or always use a dataview
or the in the datatable build in dataview what is the datatable.defaultview

The sort by the user in the datagrid is reflected in the
defaultview/dataview.

To get the rows you can than use the bindingmanagerbase.position

http://msdn.microsoft.com/library/de...itiontopic.asp

I hope this helps?

Cor
Nov 21 '05 #4
Bruce A. Julseth wrote:
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:eq**************@tk2msftngp13.phx.gbl...
Hi,

A dataview is a customized view of a datatable that supports
filtering, sorting, and searching.


http://msdn.microsoft.com/library/de...classtopic.asp

Ken
---------------------
"Bruce A. Julseth" <br***********@attglobal.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl.. .
I'm new to VB.NET and just gettng into database "Learning." How do I


decide
if I need a DataTable or a DataView.

Thanks...

Bruce

So, if I'm using a datagrid and only want to display and edit the data, I
use a DataTable which I created from my DataAdaptor. If I want to filter,
sort or search my data, I need to use a DataView.

Is my understanding correct?

Bruce

Another way to say what Cor posted is:

All datatables have a default dataview. When you bind a datatable to a
windows form datagrid you are actually binding to the datatables default
dataview.

datagrid.datasource = datatable
datagrid.datasource = datatable.defaultview

The above two statements result the same.

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Brian Bischof | last post: by
4 posts views Thread by Kris Rudin | last post: by
6 posts views Thread by David P. Donahue | last post: by
2 posts views Thread by am72de | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by haryvincent176 | last post: by
reply views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.