472,328 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

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 14991
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Brian Bischof | last post by:
I'm using a third-party tool that takes a DataTable as a parameter. I really need to pass it a DataView instead. When I try to explicitly cast the...
1
by: TaeHo Yoo | last post by:
Hi all, After sorting and grouping data using a dataview, then how to transfer the changed datatable in the dataview to a datatable in C#? ...
5
by: Richard | last post by:
Windows Forms, csharp, 20 rows in DataTable 14 shown in view after filter applied. For any of the 14 how do I do the datarow or something else thing...
4
by: Kris Rudin | last post by:
I am displaying a table of information on a web page, using an asp:table that I populate dynamically. On this page I give the user the options to...
5
by: Ron L | last post by:
I have a DataTable that is being maintained in a Model class. I also have a View class which creates a DataView from the DataTable that the Model...
3
by: Rich | last post by:
Hello, I am populating a datagridview from a datatable and filtering the number of rows with a dataview object. Is there a way to retrieve the...
6
by: David P. Donahue | last post by:
I've been looking around for ways to sort the rows in a DataTable, and everything seems to point to just changing the Sort property on that...
2
by: am72de | last post by:
Hi all, I have a problem with the DataTable.Reset(). After resetting the DataTable the count of the DataView is no longer equal with the...
1
by: Ronald S. Cook | last post by:
If I add a row to a DataView, will the row automatically be added to the underlying DataTable? If so, I'm trying to understand why anyone would add...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.