DataTable vs DataView

  • Thread starter Thread starter Bruce A. Julseth
  • Start date Start date
B

Bruce A. Julseth

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
 
Ken Tucker said:
Hi,

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

http://msdn.microsoft.com/library/d...ef/html/frlrfsystemdatadataviewclasstopic.asp


Ken
---------------------
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
 
Bruce said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top