culture

OleDB Read Excel decimal value

♀尐吖头ヾ 提交于 2019-12-31 06:01:04
问题 I am using OleDB Ace 12 to read an Excel (xslx) sheet containing a column with decimal values. When I open the Excel sheet on my PC a decimal value is correctly formatted as 1.850,50 (NLD culture with comma as decimal separator) When I'm reading out the Excel sheet using OleDB (C#4.0), the string value of this field is always 1,850.50 (US format) I've tried setting the Locale of the DataSet I fill, set the currentthread's culture and more, but the DataSet filled with OleDB adapter always

SSRS Date Culture Error

放肆的年华 提交于 2019-12-25 09:42:38
问题 I've got a strange error when trying to pass date parameters to SSRS. All of the dates are retrieved using a DatePicker and validated so that only real dates are allowed. However passing dates in the format dd/mm/yyyy causes SSRS to throw TypeMissmatchException if the day is 13 or higher. I'm assuming this is due to the culture of SSRS being set to EN-US, is it possible to change this? or do I need to convert all dates that I send SSRS into American format. 回答1: The easiest way is to send

CultureInfo for Japanese language not setting up DateTimeFormat.AbbreviatedMonthNames property correctly

时光总嘲笑我的痴心妄想 提交于 2019-12-25 04:07:03
问题 I wanted to show the date in dd-MMM-yyyy format for Japanese culture in a web application. Hence I wrote below simple code. CultureInfo cu = new CultureInfo("ja-JP"); System.Threading.Thread.CurrentThread.CurrentCulture = cu; System.Threading.Thread.CurrentThread.CurrentUICulture = cu; lbl1.Text = DateTime.Now.ToString("dd-MMM-yyyy"); But found that the label prints the month number instead of the month name. i.e. it shows 30-10-2014 instead of something 3 letter month name in japanese. After

Localize Windows Service

无人久伴 提交于 2019-12-25 03:28:16
问题 I want to Set Culture for Windows Service that I developed. Can someone recommend me a good read for or how to go about it. So far I have I Tried to do the Following OnStart() Dim oCultureInfo as CultureInfo = New CultureInfo("tr-TR") System.Threading.Thread.CurrentThread.Culture = oCultureInfo System.Threading.Thread.CurrentThread.UICulture = oCultureInfo After doing so I still see that My culture is US English. 回答1: Go to your setup which will be in the same solution. Right click on it and

DateTime.TryParse failing in Azure Web App

巧了我就是萌 提交于 2019-12-24 08:13:04
问题 My development machine's culture is en-NZ and my timezone is set to New Zealand time (UTC+12:00). A DateTime.TryParse is failing on the server, which is in West US. How can I check and change culture and time settings on my web app on the server? Can I run Powershell or C# code on the server interactively and see output, just to test stuff, like say Console.WriteLine(CultureInfo.CurrentCulture.ToString()); Any other thoughts are welcome if you think I'm approaching this the wrong way. 回答1: I

C# string comparision 'ö' 'oe' 'o' [duplicate]

ε祈祈猫儿з 提交于 2019-12-24 03:05:41
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: how to recognize similar words with difference in spelling I am trying to get returned true while comparing these 3 strings: 'voest', 'vost' and 'vöst' (German culture), because it is the same word. (In fact, only oe and ö are the same, but e.g. for a DB collation CI it is the same which is correct, because 'vost' is a misstyped 'voest') string.Compare(..) / string.Equals(..) returns always false no matter what

Can't change default language of an assembly in Visual Studio 2017

╄→尐↘猪︶ㄣ 提交于 2019-12-24 00:33:36
问题 My application supports three languages: en, es, and fr. When I build my (clean, from a template) UWP application, I get the message: warning PRI257: 0xdef00522 - Resources found for language(s) 'en,es,fr' but no resources found for default language(s): 'en-US'. Change the default language or qualify resources with the default language. So then I go into the manifest and change the default language from en-US to en-GB and when I recompile I get: warning PRI257: 0xdef00522 - Resources found

Has C#/.NET builtin conversion routines for length units?

北城以北 提交于 2019-12-23 12:26:49
问题 Has C#/the .NET library builtin routines or constants for converting e. g. millimetres to inches? If so, where can I find them? (I just do not want to produce duplicate code again and again.) 回答1: No, there are no such build in routines or constants in the framework. 回答2: Totally gratuiitous off topic reply F# has built in support for units. This is a random blog I just Binged Units Of Measure In F# 回答3: Here's a CodeProject sample that does unit conversion: http://www.codeproject.com/KB/cs

In C#, how to get the “Country or region” selected under “Region & language” in Windows 10?

China☆狼群 提交于 2019-12-22 18:32:53
问题 I am running Windows 10. When I open "Region & language settings" from the start menu, I can select a "Country or region". I am trying to get this value in a C# program. I am in Denmark. I have tried changing my country to Germany (see screenshot), but I cannot get my code to return Germany. Rebooting the computer did not help. I have written some code inspired by this thread. My code looks like this (trying various things at once, getting all the region/culture things I can think of):

Convert number into culture specific

主宰稳场 提交于 2019-12-22 14:18:09
问题 I have a number like 202667.4 . I want to convert this to number based on culture . For Ex: In "de"(German) the number should be in 202.667,40 . Any help will be greatly appreciated. Thanks. 回答1: If you want to represent existing number (say, double ) in culture specific format, try formatting : https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings double source = 202667.4; // "n" - ... group separators, and a decimal separator with optional negative sign