5

I have a CLR .NEt dll in and SQL server. The system local settings (Region/administrative/locallanaguagesettings) are changed from en-IN to en-US. But the culture in the CLR traced with Thread.CurrentThread.CurrentCulture is still en-IN

select @@Language prints englishUS

from where does the SQL server select the culture for the CLR culture? And the final question, how can I change with a system setting the used culture in a SQL CLR assembly?

tire0011
  • 1,048
  • 1
  • 11
  • 22
  • 1
    It appears that `@@language` returns the equivalent of .NET's `CurrentUICulture`, not `CurrentCulture`. Also see [this](https://stackoverflow.com/q/17052214/21567) for more information. Make sure you understand the difference between the two, and which one you want to use in your code. – Christian.K Aug 04 '17 at 09:59
  • The CurrentUICulture is set to en-US thats right. In my code the CurrentCulture is En-In and that is it what I want change to en-US. – tire0011 Aug 04 '17 at 11:49
  • The accepted answer on link that Christian.K included (https://stackoverflow.com/a/17053067/5510627) seems to point you to what you need though I have not tested. It is likely you have language (CurrentUICulture) set to En-Us but you have local (CurrentCulture) set to En-In. So you should change your locale (CurrentCulture) to be En-Us. – Matt Aug 08 '17 at 22:17

1 Answers1

0

Try setting the UICulture and the Culture to en-US in the page directive for the page(s) .as?x

<%@ Page UICulture="en-US" Culture="en-US" %>
Sean Devoy
  • 66
  • 5