Groups | Blog | Home
all groups > dotnet ado.net > july 2007 >

dotnet ado.net : How sort DataView so blanks are at bottom, not top?


Ronald S. Cook
7/11/2007 2:04:51 PM
I have a DataTable with column "Sequence". Values are like:

Sequence
--------
5
1
3
(blank/null)
7
6
(blank/null)
4


When I create a DataView and do a sort, I get

Sequence
--------
(blank/null)
(blank/null)
1
2
3
4
5
6
7

But I need the blank/nulls to be at the end like

Sequence
--------
1
2
3
4
5
6
7
(blank/null)
(blank/null)


How can I do this, please?

Thanks,
Ron

Cor Ligthert [MVP]
7/14/2007 12:00:00 AM
Ronald,

The only thing I can think about what uses a short answer is:
Add an extra column with the contents of your column
Replace in that column all spaces by ZZZZZZ (or any other high value)
Use that as the sort item.

Cor

"Ronald S. Cook" <rcook@westinis.com> schreef in bericht
news:%23wecFb$wHHA.4588@TK2MSFTNGP03.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button