[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Oliver Leamy

6/16/2002 4:27:00 PM

It is probably a basic misunderstanding on my part.

I have a dataset, and using a dataview to sort by one of
the fields. If I bind the dataview to a list object,
then I get the data sorted as planned.

HOWEVER, I want to be able to step through the dataview
in the manner that it was sorted and that is not working
for me.

With objDataViewActivities
.Sort = "ActivityType,ActivityDay,ActivityTime"
End With
DataBind()

The list object that is bound to the dataview, shows the
sorted data correctly.

In my application, I need to process the data in a sorted
manner, so I need to be able to step through the
DataView. In my innocence I tried the following:

intCount = objDataViewActivities.Count()
......
For intLoop = 0 To intCount - 1
......
strTemp = objDataViewActivities.Table. _
Rows(intLoop).Item("ActivityName")
......
lstActivities.Items.Add(strTemp)
Next

This latter code populates the list box (lstActivities)
in exactly the same order as they are in teh DataSet and
not as they are sorted in the DataView.

QUESTION: How do I step through the DataView so that I
can read the data in the sorted manner.