Hello, I have a problem with ShapeFileFeatureSource , Im sending a Query like this “Select * From M01 where colonia=‘Centro Distribuidor de Básicos’ and clave=‘010010001’” and it sends me any result in datatable, I think its because the character ‘á’ that is very common in spanish.
Well, when I see the default encoding in the ShapeFileFeatureSource is 1252, I´ve changed this to : Default, Unicode, etc. but it doesn´t work ( MyShapeFileFeatureSource.Encoding = Encoding.Unicode;)
The code is ok when I send a query without characters á, é, í, ó, ú
ShapeFileFeatureSource MyShapeFileFeatureSource = new ShapeFileFeatureSource(strPathMapaSHP);
MyShapeFileFeatureSource.Open();
DataTable dtDatos = MyShapeFileFeatureSource.ExecuteQuery(strQuery);
MyShapeFileFeatureSource.Close();
When I use a query like this “Select * From M01 where id=6524” the result datatable is like the attached image, you can notice that the character ‘á’ is replaced by other, Im sure this is related to encoding but I don´t know what else can I do, please help me.
Thanks in advance.
Problem with ShapeFileFeatureSource & Encoding
Hi,
It looks your screen shots haven’t been upload succeed.
And have you tried to use some other encoding like Utf-8?
Regards,
Don
Hello Don, yes, I´ve tried using MyShapeFileFeatureSource.Encoding = System.Text.Encoding.GetEncoding(“UTF-8”); but the datatable returned with any result. I don´t know how to solve this issue.
I´ve attached a sample of my map ( M01 ) and the image with the view of the datatable(please see the colonia column) when I send a query using the ID.
I am very grateful for your help.
M01.zip (11.5 KB)
Hi,
Sorry it looks my development environment cannot support OLEDB query now. I need some time to fix it.
I will try helping you about this after environment preparing and update status here.
If you have any update please also let me know.
Regards,
Don
hello Mike, I´ve been testing with other encodings but it doesn´t work yet, I hope you can help me to solve this issue, I will appreciate a lot.
Thanks again!
Hello? any answers about this?
Hi Julieta,
Sorry to let you wait so long.
We just focus on release new 8.0 and haven’t get time to handle the issues.
Our developer will takes time for this problem the next work day.
Regards,
Don
Hi Julieta,
After we taking more investigation, seem like it’s still in progress now, actually, change current threading cultureInfo, Encoding, doesn’t take effect, I posted here and was wondering if you guys have ever experienced OLEDB “Microsoft.ACE.OLEDB.12.0” to do the query before, maybe you guys are expert to deal with Spanish, any shots or ideas will be appereciated.
Regards,
Don
Hello Don, I´ve published my webapp in my test server. This server has windows server 2008 R2 Standard SP1 64bit , and now my code is not working, this is the code:
strQuery = “Select * From M01 Where Colonia=‘napoles’ and clave = ‘12345’”;
ShapeFileFeatureSource MyShapeFileFeatureSource = new ShapeFileFeatureSource(strPathMapaSHP);
MyShapeFileFeatureSource.Open();
DataTable dtDatos = MyShapeFileFeatureSource.ExecuteQuery(strQuery);
MyShapeFileFeatureSource.Close();
You have mentioned before that the ExecuteQuery method use OLEDB, do you know if any library is missing? do I need to install any libraries in my server?
Thanks in advance.
Hi Julieta,
I am guessing this might be your server is 64 bit and the OLEDB only support 86 bit. So, would you let us know How is your application compiled? Is it compiled with AnyCPU option? If yes, you need to change it to x86, since ACE OLEDB 12 provider does not support 64-bit mode, and with AnyCPU option application will run in 64-bit mode in 64-bit environment.
Hope it helps.
Troy
Hello, you´re right, I´ve compiled my application with x86 and now it´s working. If someone has the same problem should also change the advanced settings in Application Pool, the option "Enable 32 bit applications" must set to TRUE. The Application Pools are configured in IIS.
Julieta,
Oh,yes, we can configure the IIS application pool to support 32 bit app. So good to hear it works.
Any question, don’t hesitate to let us know.
Troy