Update Data View

Moishe

Member
Joined
May 30, 2003
Messages
24
Hi All
Im using data view for filtering my dataset.
Does anyone know how to update dataview so my dataset will be updated also like I can update dataset with update method
Thanks for any help
 
suppose Ds is your dataset

First create a DataView Manager passing it your dataset as parameter :
Dim DVManager As New DataViewManager(ds)
Then declare a DataView and initialize it using the CreateDataview method passing it as parameter the datatable of the dataset
Dim dv As New DataView()
dv = dvmanager.createDataview(ds.tables("yourtablename"))
Now your dataview is directly attached to your dataset, changes in it will affect the dataset and visa versa .
Hope this helps...
 
Moishe,

i appologize for the first reply, it doesnot apply to your case

You can use it if you want to create a dataview that is independent from your dataset tables.

As for your case, I think that it is enough to change the values of your dataview, it will directly affect your dataset.
 
Since data views are based on data tables, updating the underlying data tables should update the data views.

myDataAdapter.Update(myDataSet, myDataView.Table.TableName)
 
Back
Top