Syntax error caused by Regional settings

  • Thread starter Thread starter Darren Grafton via .NET 247
  • Start date Start date
D

Darren Grafton via .NET 247

(Type your message here)

--------------------------------
From: Darren Grafton

I'm trying to write a webservice consuming program in vb .net toconsume a webservice from Quebec, Canada. I'm getting thewierdest error; when I changed my regional settings through thecontrol panel I get a syntax error in my code!! My usualsetting is English United States and I changed it to FrenchCanada. I'm not gonna post the whole code but I'll put the linethat gives an error. Has anyone ever heard of or experiencedthis kinda thing befor. I'm not even kidding I switched backand forth serveral times and only get the error while in Frenchcanada, while the program works fine in English United States

Here's the line:

PatientRows = RawPatients.Select("PatientNum = "& tempRow("PatientNum"))

This is just too wierd for me
 
Hi Darren
I have seen such situation before and the reason was like this. Check if
you are using any decimal numbers separators within your code, this differ
in French from English, commas may be interpreted instead
hope this helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
.. . .
I'm getting the wierdest error; when I changed my regional settings
through the control panel I get a syntax error in my code!!

PatientRows = RawPatients.Select("PatientNum = " _
& tempRow("PatientNum") _
)

Do you have "Option Strict On"?? I'm guessing not.

If the "PatientNum" field in the tempRow row is a number and is
large enough to need thousand separators, the [Evil] Type Coercion
from [something like] Integer to String (to do the concatentation) might
be putting the separators in. Try this instead :

PatientRows = RawPatients.Select( "PatientNum = " _
& tempRow("PatientNum").ToString( "0" ) _
)

That should (I think) override any local numerical settings and force
the number to be formatted without /any/ dots, commas, blips, blobs
or whatever.

HTH,
Phill W.
 
Back
Top