DirectorySearcher sort order for european characters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

H

We are trying to get a aspx page to sort members but it treats swedish characters wrongly. How do we get it to sort according to european sort orders

Thank

/hass
 
hass said:
Hi

We are trying to get a aspx page to sort members but it treats swedish characters wrongly. How do we get it to sort according to european sort orders?

Thanks

/hass


I'm not very with the DirectorySearcher class, so I'm not sure if you
are expecting the results from the FindAll() method to be already sorted
or not, but in any case you have several options, including:

- sort the strings you get using a SortedList - if you create your
SortedList instance using "new SortedList( null)", then the strings you
add into the sorted list will be compared using the String class'
CompareTo() method which uses the current culture information to perform
the comparison.

So as long as you set the current culture to the user's culture, just
drop the strings you want sorted into the SortedList, and you're there.

See this for more information:

http://msdn.microsoft.com/library/en-us/cpguide/html/cpconsortingdataforspecificculture.asp
 
Thanks alot, but I have tried this and it doesn't work.

The regional settings on the server are swedish but those on the DC are english, could it be this?

/hass
 
Yes. The sortorder is determined by the server running the AD service.

Willy.
 
Back
Top