Dataview sort not working

  • Thread starter Thread starter Peter Proost
  • Start date Start date
P

Peter Proost

Hi group,

I've got this, a dataset which contains
ds.tables(0).rows(0).item(0) = "HO"
ds.tables(0).rows(1).item(0) = "L1"
ds.tables(0).rows(2).item(0) = "L2"
ds.tables(0).rows(3).item(0) = "O1"
ds.tables(0).rows(3).item(0) = "BR"

then I want to sort it using a dataview like this:

Dim dv As New DataView(ds.Tables(0))
dv.Sort = dv.Table.Columns(0).ColumnName
'also tried dv.sort = "col1" 'col1 is the name of the column in the select
statement

but after the dv.sort, dv.table.rows(3).item(0) still is "BR", but "BR"
should have become the first row, so I'm doing something wrong but I don't
no what

Greetz Peter
 
Figured it out, I should use a datarowview when looping the dataview
Greetz Peter
 
Peter,


That is exactly right, the dable to which the dataview is connected should
show you that.
dv.table.rows(3).item(0) "BR"
The dataview
dv(3)(3).ToString should give you "L2" or something

I hope this helps?

Cor
 
Hi Cor,

that's exactly what it does, but if you've had a headache all day and then
bump your head on a closet, you're thinking isn't that clear anymore ;-)
that's why I didn't found it sooner

thanks for the help

Greetz Peter
 
Back
Top