Will a row added to a DataView automatically be added to the underlying DataTable?

R

Ronald S. Cook

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
a row to a DataView when they may as well just add it to the DataTable. A
DataView is just a perspective on a DataTable anyway, right? I mean a
DataView doesn't actually hold any data.

Thanks,
Ron
 
C

Cor Ligthert [MVP]

Ron,

Think that you can have a reference to a dataview, however not to the
datatable. You have instanced a datatable in a method, than it is easier to
use the dataview, (It is even more usable as you use a currencymanager )

A little bit pseudo code bellow

Public sub1 ()
dim dt as new datatable
dim dv as dataview()
mydatagrid.datasource = dv
End sub 1

Public sub2
(directcast (mydatagrid.datasoure, dataview).Add(whatever)
End sub 2

Cor
 

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

Top