How to make or dataview.rowfilter use accent-insensitive? RRS feed

  • Question

  • I have a datatable that contains a column named "name". Among the names, there is, for example, "João".


    What I need to do is to execute"name like 'Joao'") (note: NO accent) and still find the row. Like MS SQL when you use accent-insensitive.


    It seems and dataview.rowfilter are case-insensitive but accent-sensitive. Is there anything easy I can do to get what I want, other than loop-thru using compareinfo?


    Thursday, January 31, 2008 4:21 PM

All replies

  • Hello,


    I know that it's possible to do ( ds is the dataset containing the datable dt = ds.Tables[0] )

    ds.Tables[0].CaseSensitive = false


    dt.CaseSensitive = false


    ds.CaseSensitive = false     ( in this last case : that's for all datatables included in the dataset )


    For the problem of accent-sensitive, you should have a look about the namespace System.Globalization. Maybe you will find something to exploit.


    Please, if i have well understood , your are using dataset/datable out of databases ( so no Sql Server or Access...). Is it right ?


    Have a nice day



    Friday, February 1, 2008 9:14 AM
  • The dataset/datatable is first filled out with data of a MS SQL server, and then I use

    Friday, February 1, 2008 9:21 AM
  • Hello,


    I think that when you are using a SqlCommand , you are connected to the database and the choice accent-sensitive or not is depending of the database options. So a direct SELECT on a table of a database may be accent-insensitive.


    When you use datatable and dataview.Select() or .rowfilter, you are in a disconnected logic so it"s impossible to work with a filter accent-sensitive/accent-insensitive. A dataview or Datatable is disconnected from the database.


    I hope i was clear with my explanations.


    Have a nice day

    Friday, February 1, 2008 6:14 PM