DataTable.Select - Thread.CurrentThread.CurrentCulture - String.Format

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi NG,

in my application a <myDataTable>.Select fails with "Syntax error in the
expression."
It took me a while, isolate the cause to this:

To select some datarows from a data table I am using a select sting like
"selectStr = String.Format("x >= {0}", aDoubleVar)".
The Thread.CurrentThread.CurrenCulture is set to "en-US" where the
Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencyDecimalSeparator is
a '.' as expected. BUT.... debugging my selectStr it turned out to be "x>=
2,14" !

After a while I had the Idea to check ControlPanel->Regional and
LanguageOptions and YES, the user has changed the decimal seperator.

So I currently looks like
- String.Format uses the ControlPanel Settings ","
- The DataTable uses Thread.CurrentThread.CurrentCulture "."

Is this a BUG in the Framework, or in my HEAD? Is there something I missed?
Any help or hint on this subject is very appreciated.

Regards
Rainer Queck


.



Relevant Pages

  • Re: sql functions
    ... > i can cut the function code from books on-line and it stil fails. ... "doesn't work" then you have a syntax error on line 5. ... What is the database ...
    (microsoft.public.sqlserver.programming)
  • Re: using TCL with sqlite database...
    ... which fails and ... ... should give you a syntax error, ... Can it be that you have a "catch" somewhere which hides the error message? ... sqlite probably doesn't allow you to use a variable as table name ...
    (comp.lang.tcl)
  • Re: Why cant I use "or" here?
    ... Gary Wright wrote: ... fails... ... it is a syntax error, for some mysterious reason. ...
    (comp.lang.ruby)
  • Re: Is there an updated Ghostscript for VMS?
    ... I have tried downloading the latest version, but the build fails with ... MMK spitting out a "syntax error" from one of the .mak files. ...
    (comp.os.vms)
  • Re: detail bug confirmation (qualified identifiers, dotted unit names)
    ... >> at work where I only have D6e), I tried to isolate the bug, can sb ... >> confirm that this fails on the textfile declaration with D7 (and ...
    (borland.public.delphi.non-technical)