Questions tagged [currentculture]

a Thread property in the .NET System.Threading namespace or a CultureInfo property in the .NET System.Globalization namespace

CurrentCulture refers to either the Thread.CurrentCulture property in the .NET System.Threading namespace or the CultureInfo.CurrentCulture property in the .NET System.Globalization namespace.

In both cases, this property is used to get or set the System.Globalization.CultureInfo object that represents the culture of the current thread.

Resources

Related Tags

139 questions
0
votes
1 answer

Are .net SqlDataReader methods culture invariant

I can't really find a definitive answer to what happens if for example my decimals are stored in the database with different culture settings and I want to get them via a SqlDataReader into my program. Will the ',' and '.' always be correctly parsed…
user1246576
  • 51
  • 1
  • 8
0
votes
0 answers

Converting Data table to Generic List does not use decimal separator Information from culture and uses period(.) as a separator always

I have written an extension method to convert the Datatable to a generic observable collection as below: public static ObservableCollection ToObservableCollection(this DataTable dt) { var columnNames =…
Mallikh
  • 16
  • 5
0
votes
0 answers

Managing Culture in class library

I'm developing SVC services and a class library in .Net 4.5. First of all, all the services are receiving some headers to check the user. WebOperationContext woCtx string token = woCtx.IncomingRequest.Headers["token"]; // check the token via WS and…
Emanuele
  • 648
  • 12
  • 33
0
votes
1 answer

How to get the current culture in a controller (in a custom module of Orchard CMS)

I need to get the current culture in a controller in a custom module; I know how to get it from a razor view: @{ var currentCulture = WorkContext.CurrentCulture; } but in the controller I have no access to the WorkContext and I can't find…
Daniele Armanasco
  • 7,289
  • 9
  • 43
  • 55
0
votes
0 answers

Set culture for each area in asp.net MVC

In my MVC app, I've created areas for each language. Inside controllers/views of each area I want specific culture to be used. I have area for TR and EN. I've modified the web.config files for the areas but seems MVC isn't respecting this setting.…
HasanG
  • 12,734
  • 29
  • 100
  • 154
0
votes
2 answers

Xamarin Form: How do i change from current device time to different country time

I am not too familiar with date time. I am currently wonder how can I convert the existing time of the device to a different countries' date/time. E.g. App.CurrentDate <- which display the device setting date/time. I want it to be in different…
LittleFunny
  • 8,155
  • 15
  • 87
  • 198
0
votes
1 answer

Set Culture in HttpModule with cookies

I'm currently looking for a better solution to what I have now. I hoping someone could help me on this one. I'm creating a web page and I'm trying to set the culture of the website manually with cookies. I have 2 buttons
Davy Quyo
  • 102
  • 6
0
votes
0 answers

C# CultureInfo ignoring impersonation

I want to get the CultureInfo used by another user (that is not logged on). I thought I could use impersonation as described in this question, but CultureInfo seems to ignore the impersonation. If I do WindowsIdentity.GetCurrent().Name) I get the…
TheHvidsten
  • 4,028
  • 3
  • 29
  • 62
0
votes
1 answer

CultureInfo CurrentCulture does not correspond to the system culture

I my .Net application I use CurrentCulture to format dateTime and numbers. When on the Localhost this works like a charm and the format changes when I change the system's culture. When I publish my application though it does not. As a test I added…
user6386826
  • 131
  • 1
  • 1
  • 10
0
votes
1 answer

How to change Application Culture at runtime for DataGrid(Localization)?

I have changed the Application culture at run-time by using different resource file. But it is not reflect in data grid which displays the old one. Changing culture : System.Threading.Thread.CurrentThread.CurrentUICulture = new…
Srinivasan
  • 131
  • 1
  • 8
0
votes
2 answers

Switch connection string based upon culture when using NInject

Please can anyone advise if it is possible to switch connection strings for a DbContext using Ninject binding, based upon Current Culture? My current (non-working) cod is as below. private static IKernel CreateKernel() { var kernel =…
Dib
  • 2,001
  • 2
  • 29
  • 45
0
votes
0 answers

Why Change IE11 Language does not have effectiveness on date format in Windows 10?

Just a simple question, i notice that in my mvc application the current culture thread does not follow the language set in browser setting. I use IE11 and on windows 10 (the last released build). Whatewer the date format was set to English (US)…
0
votes
2 answers

Binding resource with Xaml x:Uid some times not working

I have an UWP app with two languages. For some labels I've used: Loader.GetString("LableName") in code-behind and for the others have used: x:Uid in XAML. Users can change the CurrentCulture using a button like this: CultureInfo.CurrentCulture =…
n.y
  • 3,343
  • 3
  • 35
  • 54
0
votes
1 answer

MS Test agent threads not picking up system culture

It seems that the agent threads spawned by MS Test when running the tests do not have their current culture set to the current system culture. More specifically, the Thread.CurrentThread.CurrentCulture property always returns the "en-US" culture,…
Gabriel S.
  • 1,347
  • 11
  • 31
0
votes
1 answer

Windows service and default code page/culture setting?

I'm writing a service that will read a file from a directory, read the contents of the file and process the content. I am having issues with Swedish characters that are read from the file as they are beeing translated into "garbage chars" by the…
user181261