1

I am programming an "Articles Archieve" contains articles about law. For this, I am using Linq to SQL and SQLite. And authors' names contain UTF-8 characters. When I search "oğuz" term in the search textbox, it returns KARABULUT, Ayşe/EMİR, Oğuz - PİLAT, Oğuz/GÜNAŞTI, Emin - AYDOS, Oğuz Sadık - İNAL, Oğuz Mehmet. But it does not find and does not return OĞUZ, Habip - OĞUZOĞLU, Ali, OĞUZ, Kemal - OĞUZMAN, Cemal.

In the same way, when I search "OĞUZ" term in the search textbox, it returns same datas as "oğuz" term. Here is my code:

IQueryable<article> results = (from m in _db.articles
                            where m.author.ToLower().Contains(textBox1.Text.ToLower())
                            select m).Distinct();

How can I manage this?

1 Answers1

1

Are you try this example. currentculture and index of maybe works for you.

  List<article> temp= (from m in _db.articles
                       join k in _db.keywordss on m.id equals k.aid                                   
                       select m).Distinct().ToList();

  List<article> result= temp.Where(l => CultureInfo.CurrentCulture.CompareInfo.IndexOf(m.author.ToLower(), textBox1.Text.ToLower()) >= 0) ).ToList();

EDIT: compare options and add this tolower() for case sensivity i hope this work now and check this page.

Community
  • 1
  • 1
  • 1
    Everything is same. And I don't know why it is. Is it may be due to the SQLite? –  Jan 20 '16 at 14:03
  • Absolutely. First I set IQueryable type, so it gave me error. But later, I changed the type, it was good. –  Jan 21 '16 at 10:16