sql server - How to check which locale is a .NET application running under, without having access to its sourcecode? -


context: i'm in charge of running service written in .net. proprietary application. uses sql server database. ran user member of administrators group in local machine. worked alright before added machine domain.

so, added machine domain (win 2003) , changed user member of power users group , now, the

problem: of sql sentences tries execute "magically" in spanish localization (where , separates floating point numbers instead of .), leading errors.

there fewer columns in insert statement values specified in values clause. number of values in values clause must match number of columns specified in insert statement. @ system.data.sqlclient.sqlconnection.onerror(sqlexception exception, boolean breakconnection)

operating system , regional settings in machine in english. asked provider of application , said:

looks have combination of code running under spanish locale, , sql server under english locale. sql expects '15.28' , not '15,28'

which looks wrong me in various levels (how can sql server distinguish between commas separate arguments , commas belonging floating point number?).

so, code seems grabbing spanish locale somewhere, don't know if it's user runs as, or someplace else (global policy, maybe?). question is

what places localization defined on machine/user/domain basis?

i don't know places must search culprit, please me find it!

there 2 types of localisation in .net, both settings cultures can found in these variables (fire .net command line app on machine see says):

system.thread.currentthread.currentculture & system.thread.currentthread.currentuiculture

http://msdn.microsoft.com/en-us/library/system.threading.thread_members.aspx

they relate settings in control panel (in regional settings part). create .net command line app, call tostring() on above properties, should tell property at.

edit:

it turns out setting locales per user held here:

hkey_current_user\control panel\international 

it might worth inspecting registry of user spanish locale, , comparing 1 set or whichever locale require.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -