Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using ArcGIS Java Script API version 2.8 & using query layer in ArcGIS server.

The data is coming from sql server and most of the data is in Arabic language. I am sorting the data and according to the particular map is displaying.

I have created the query task and result will be displaying in combo-box but when I select Arabic record then the map is displaying blank if I select English record then its displaying correctly. For details Please check the screen shot.

The column type is “nvarchar” in sql server and in query task I am using where condition as follows But still getting an error

query.where = "STATE <> N''" (In sql server query works if I use N'')

What I tried:

1.Changed the query parameter. 2.It works perfect for English names. 3.Added UTF 8 encoding. 4.Upgraded API to 3.2 (latest one) 5.In Sql server where query works successfully.

Still getting an error...Any help will be great!!! thanks in advance : )


I confirmed through REST API and through API I was able to query to the data base. Please check the new screen-shots

So as far as the logic the the information is coming but why its not displaying on the map (its interesting) also I have check parameters in the map service & Still researching..

enter image description hereenter image description hereenter image description hereenter image description hereenter image description hereenter image description here

share|improve this question
Def an encoding an issue. Focus on the error. What REQUEST/RESPONSE is being fired when you choose Arabic. (use Fiddler/Firebug). Also try to execute the query directly against the REST services directory to see if you can replicate. Might need to pass in a unicode object? Edit ur answer with these findings. –  Simon Dec 24 '12 at 13:18
@ Simon thanks for your reply..I will check the parameters and let you know. Thanks for the quick response : ) –  Sunil Dec 24 '12 at 13:56

1 Answer 1

up vote 3 down vote accepted

I was able to find the answer and thanks a lot Simon for your important points/guidelines

I have attached JS fiddle with this and I have changed the following things 1.In query task I used query.where = "1=1"; 2. On line no 275 I have inserted "N" for varchar data type and it works successfully!! layerDefs[0] = "STATE = " + "N'" + selItem.value + "'";

3.The complete JS Fiddle is here ( Only I have changed the server name)

Thanks again to Simon : )

share|improve this answer
no probs. Thanks for sharing how u solved it. Pls mark this answer as the one that solves the Q. (green tick to the left) –  Simon Dec 26 '12 at 13:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.