By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,417 Members | 904 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,417 IT Pros & Developers. It's quick & easy.

Sorting dataview containing NonAlphanumeric apostrophe characters

P: 2
When using a SqlDataReader to retrieve data from a SQL Server the data is ordered according to the Order By clause in the query. So that if I get a list of names and Order By lastname ascending here is an example of the order:
O Leary, Shannon
O'Baine, Michael
O'Neil, Veronica
Oboyle, Michael
Where the nonalphanumeric apostrophe character comes before alphanumeric characters. However if I pull the data from SQL Server into a DataView and then set the Sort Property to "LastName asc" then the order is:
O Leary, Michael
O'Baine, Michael
Oboyle, Michael
O'Neal, Veronica
In the DataView sort the nonalphanumeric apostrophe character seems to be ignored. Does anyone know how I can get the DataView to sort the names so that the apostrophe is placed before alphanumeric characters.
Feb 20 '13 #1
Share this Question
Share on Google+
2 Replies


Mikkeee
P: 94
You're going to need to handle the sorting yourself. Take a look at http://msdn.microsoft.com/en-us/library/ms171608.aspx
Feb 23 '13 #2

P: 2
Thanks Mikkeee for the link.
Feb 25 '13 #3

Post your reply

Sign in to post your reply or Sign up for a free account.