Connector filtering - diacritics

I need to filter in grid by words with czech diacritics, for example I filter by “pŘíklad”, but results are shown for the letter without wedges like pRiklad. So instead of Ř it looks for R. Those letters are ěčř. How can I fix it please?

SELECT in db works
page has utf-8 encoding
xml response is utf-8 too

Most probably caused by DB/table collation.

To be sure that problem is DB related - try to enable logging and check the sql code which connector generates.

docs.dhtmlx.com/doku.php?id=dhtm … nd_logging

I modified connector source code and forced SELECT as unicode by N’pŘíklad’.
It returns the correct query and correct row count(in log).
But the result in grid is still wrong :frowning:

XML returns correct row count(), but there are 5 wrong rows in grid

Please provide a log file for the incorrect processing scenario, also, can maybe you have an online demo for the problem ?

I found the problem but don’t have the simple solution yet.
The query for getting the row count and for getting data into datatable are not the same.
So the problem is in data query, because the WHERE condition in it looks like —WHERE (nazev like ‘‘Ř%’’)’—. There are 2 apostrophes after N, so it doesn’t work properly.

Can you provide the render command from connector file and exact sql code which generated for the filtering query?

There is connector log below. As I said the problem is there are 2 apostrophes after N in WHERE (nazev like N’‘Ř%’’)’

11:44:46 MSSQLAdapter: Entering: ExecuteSelectQuery
11:44:46 MSSQLAdapter: Creating SelectQuery from TableName: (SELECT firmy.cislo, firmy.nazev, firmy.ico, firmy.dic, firmy_c_typ_instituce.text,firmy.id FROM firmy LEFT JOIN firmy_c_typ_instituce ON firmy_c_typ_instituce.id=firmy.typ_instituce_id WHERE (firmy.deleted != 1 OR firmy.deleted IS NULL)) firmy, Fields: cislo, nazev, ico, dic, text, id, Rules: (nazev like N’Ř%’), OrderBy: , StartIndex: 0, Count: 50
11:44:46 MSSQLAdapter: Select query: declare @handle int,@rows int;exec sp_cursoropen @handle OUT, ‘SELECT cislo, nazev, ico, dic, text, id FROM (SELECT firmy.cislo, firmy.nazev, firmy.ico, firmy.dic, firmy_c_typ_instituce.text,firmy.id FROM firmy LEFT JOIN firmy_c_typ_instituce ON firmy_c_typ_instituce.id=firmy.typ_instituce_id WHERE (firmy.deleted != 1 OR firmy.deleted IS NULL)) firmy WHERE (nazev like N’‘Ř%’’)’,1, 1, @rows OUT;select @handle, @rows;exec sp_cursorfetch @handle,16,1,50;exec sp_cursorclose @handle;
11:44:46 MSSQLAdapter: Exiting: ExecuteSelectQuery
11:44:46 DataRequest: Selecting items count.
11:44:46 MSSQLAdapter: ExecuteGetCountQuery: TableName: (SELECT firmy.cislo, firmy.nazev, firmy.ico, firmy.dic, firmy_c_typ_instituce.text,firmy.id FROM firmy LEFT JOIN firmy_c_typ_instituce ON firmy_c_typ_instituce.id=firmy.typ_instituce_id WHERE (firmy.deleted != 1 OR firmy.deleted IS NULL)) firmy, RequesteFields: 1 as dummyValue, Rules: (nazev like N’Ř%’)
11:44:46 MSSQLAdapter: Creating SelectQuery from TableName: (SELECT firmy.cislo, firmy.nazev, firmy.ico, firmy.dic, firmy_c_typ_instituce.text,firmy.id FROM firmy LEFT JOIN firmy_c_typ_instituce ON firmy_c_typ_instituce.id=firmy.typ_instituce_id WHERE (firmy.deleted != 1 OR firmy.deleted IS NULL)) firmy, Fields: 1 as dummyValue, Rules: (nazev like N’Ř%’), OrderBy: null, StartIndex: 0, Count: 0
11:44:46 MSSQLAdapter: Select query: SELECT 1 as dummyValue FROM (SELECT firmy.cislo, firmy.nazev, firmy.ico, firmy.dic, firmy_c_typ_instituce.text,firmy.id FROM firmy LEFT JOIN firmy_c_typ_instituce ON firmy_c_typ_instituce.id=firmy.typ_instituce_id WHERE (firmy.deleted != 1 OR firmy.deleted IS NULL)) firmy WHERE (nazev like N’Ř%’)
11:44:46 MSSQLAdapter: Result: 2

Hi,
connector escapes all quotes in select query(doubles them),
there is no provided way to prevent it. You may try to override this behavior in connectors sources
file -
DatabaseAdapter.cs
method -
protected virtual string CreateSelectQuery (line 100, in connectors v.1.1)

Why is there the cursor and all the stuff around it?
The first table is empty and in the second there is a handle and row count.
So what if I remove the cursor and leave only the query.

I mean it works then but it can’t be there just for nothing, can it?

Hi,
as far as i remember, cursor is needed only for dynamic loading(when you need to select M records, starting from N-th row).
So if you don’t use dyn. loading or paging, you may remove it, or replace by your own implementation