简体   繁体   中英

Search and sort not working for unicode strings

I have a database where names are stored in unicode nvarchar field in amharic language. I want to search and sort the data and I used this code.

student=student.Where(s=>s.Name.Contains(searchString));
student=student.Orderby(s=>s.Name);

student is a db context class. Both the search and sort doesn't work. It works for English string but for amharic string it brings all records unfiltered an unsorted.

What can I do?

Right click on your database > Properties > Options > Collation

Choose one item according to your locale.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM