Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

"ModifiedCurrent" and "ModifiedOriginal"

Hi,

I am making my first vb.net program with a dataview.
I would like to create 2 arrays. The first with the elements of ModifiedOriginal of the dataview and the second with ModifiedCurrent.

view_current.RowStateFilter = DataViewRowState.ModifiedCurrent
        Dim arr1(view_current.Count - 1) As Object
        view_current.CopyTo(arr1, 0)

        view_current.RowStateFilter = DataViewRowState.ModifiedOriginal
        Dim arr2(view_current.Count - 1) As Object
        view_current.CopyTo(arr2, 0)

When I do this the 2 arrays are filled with the same values. What can I do to get the good values?

tnx in advance

Tom de Troch

Tom de Troch
Friday, March 26, 2004

Use 
DataRow.Select(filter, sort, *DataViewRowState*)

Duncan Smart
Friday, March 26, 2004

should have been DataTable.Select(...)

Duncan Smart
Friday, March 26, 2004

Exactly, it should have been with datatable. Similarly, though MS is comparing the DataView with View in Database, there is no way you can create a DataView for whatever columns you want without any sort expression.

Assuming if you have a DataTable with 10 columns and you want to create 2 different DataViews each with different 5 columns, you got no options in ADO.NET.

Ram
Sunday, March 28, 2004

I tried it your way but I seems I did something wrong!

Dim origdr As DataRow() = Selection.mytable.Select("", "", DataViewRowState.ModifiedOriginal)

Dim currdr As DataRow() = Selection.mytable.Select("", "", DataViewRowState.ModifiedCurrent)

The values in origdr and currdr are the same. Could you help me one more time?

Tom de Troch
Monday, March 29, 2004

I found it!

I have created 2 views. Now I can set the ModifiedCurrent and ModifiedOriginal.

tnx anyway

Tom de Troch
Tuesday, March 30, 2004

*  Recent Topics

*  Fog Creek Home