How to sort dataview table on string datatype column contains all numbers: 
Author Message
 How to sort dataview table on string datatype column contains all numbers:

All,

How to sort dataview table on string datatype column contains all
numbers:
Ex. dv.dt.Col1 (datatype is string) contains the following values (all
are integer)

Col1
-----
1
2
4
6
8
10
12
18
19
20

dv.sort = "Col1"

Dim dt As New DataTable()
Dim dr As DataRow
Dim dv As New DataView()

dv.table = dt
dv.sort = "Col1"

For Each dv.Table.Rows
   Debug.Writeline(col1)
Next

I get the following output:
--------------------------
1
10
12
18
19
2
20
4
6
8

Can anyone tell me, how to get the data in the following order,
---------------------------------------------------------------
1
2
4
6
8
10
12
18
19

Note* I did convert the column to int32 (setting datatype) in the
program but no result.

Thanks,
Sudhakar



Mon, 15 Aug 2005 02:12:11 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. HOWTO Sort ListView ID Column as if the ID were a NUMBER not STRING

2. Sorting DataView using a column from its ParentRow (DataRelation)

3. Sorting DataView using a column from its ParentRow (DataRelation) - Revisit

4. converting a string to a long (string contains a Hex number)

5. Sorting dir entries containing numbers

6. getting column datatypes of mssql database table

7. Openschema problem while determining the datatype of a table column

8. Normalizing non-normal tables already containing data;OR changing columns into rows

9. Proof if String contains only numbers

10. RDO: Connecting to SQL server table containing an identity column

11. how to sort a date or number column in a listview report mode

12. Sorting ListView by a column with numbers/dates

 

 
Powered by phpBB® Forum Software