Sorting Dataviews

G

Guest

I have a dataview setup like this:
DataView.Table = dataset.Tables(0)

DataView.Table.Columns.Add("Sequence", System.Type.GetType("System.Int16"))

Dim count As Integer

For count = 0 To dataset.Tables(0).Rows.Count - 1

DataView.Table.Rows(count)("Sequence") = count

Next


later I do:
DataView.Sort = "Sequence"

& loop though the Rows. If I interfere with loading the sequence column it
dosnt sort.

Later on I might want to swap 2 rows by changing their sequence. Again the
dataview does not sort. The helptext implies no particular restrictions I
can see & I dont see any warnings or errors generated.

In addition I am holding the dataview as a session variable. Will that break
anything ?

Does anyone have any ideas ?
 
G

Guest

I have a dataview setup like this:
DataView.Table = dataset.Tables(0)

DataView.Table.Columns.Add("Sequence", System.Type.GetType("System.Int16"))

Dim count As Integer

For count = 0 To dataset.Tables(0).Rows.Count - 1

DataView.Table.Rows(count)("Sequence") = count

Next


later I do:
DataView.Sort = "Sequence"

& loop though the Rows. If I interfere with loading the sequence column it
dosnt sort.

Later on I might want to swap 2 rows by changing their sequence. Again the
dataview does not sort. The helptext implies no particular restrictions I
can see & I dont see any warnings or errors generated.

In addition I am holding the dataview as a session variable. Will that break
anything ?

Does anyone have any ideas ?

OK I'm a dork !! I was using DataView.Table.Rows(x) to get the data back not
DataView.Item (x) o DataView(x) since item is the default.
 

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