473,503 Members | 3,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Globalization not working as intended when using da-DK

Hi.

I have a strange problem. We have an asp.net application running on
several server with different setups.
On 2 of our servers we experience that the globalization settings are
misbehaving.

We have boiled the problem down to this: (exemplified by a very simple
page)

protected void Page_Load(object sender, EventArgs e)
{
Response.Write(Thread.CurrentThread.CurrentCulture .Name + "<br />");
Response.Write(2.ToString("c", Thread.CurrentThread.CurrentCulture) +
"<br />");
Response.Write(DateTime.Now.ToString() + "<br />");
}

Output is the following:
da-DK
$2.00
8/30/2007 5:14:02 PM

Since currentCulture is "da-DK" i would have expected the something
like the following:
kr 2.00
30-08-2007
This is in fact the result coming from the servers that are working.

How come the Culture is not formatting the values correctly?

Thanks for the help..

Aug 30 '07 #1
5 1813
What if you display CurrentUICulture ?

---
Patrice

"Basildk" <Th*************@gmail.coma écrit dans le message de news:
11*********************@22g2000hsm.googlegroups.co m...
Hi.

I have a strange problem. We have an asp.net application running on
several server with different setups.
On 2 of our servers we experience that the globalization settings are
misbehaving.

We have boiled the problem down to this: (exemplified by a very simple
page)

protected void Page_Load(object sender, EventArgs e)
{
Response.Write(Thread.CurrentThread.CurrentCulture .Name + "<br />");
Response.Write(2.ToString("c", Thread.CurrentThread.CurrentCulture) +
"<br />");
Response.Write(DateTime.Now.ToString() + "<br />");
}

Output is the following:
da-DK
$2.00
8/30/2007 5:14:02 PM

Since currentCulture is "da-DK" i would have expected the something
like the following:
kr 2.00
30-08-2007
This is in fact the result coming from the servers that are working.

How come the Culture is not formatting the values correctly?

Thanks for the help..

Aug 30 '07 #2
On 30 Aug., 17:30, "Patrice" <http://www.chez.com/scribe/wrote:
What if you display CurrentUICulture ?

---
Patrice

"Basildk" <Thomasboniel...@gmail.coma écrit dans le message de news:
1188487053.814585.41...@22g2000hsm.googlegroups.co m...
Hi.
I have a strange problem. We have an asp.net application running on
several server with different setups.
On 2 of our servers we experience that the globalization settings are
misbehaving.
We have boiled the problem down to this: (exemplified by a very simple
page)
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(Thread.CurrentThread.CurrentCulture .Name + "<br />");
Response.Write(2.ToString("c", Thread.CurrentThread.CurrentCulture) +
"<br />");
Response.Write(DateTime.Now.ToString() + "<br />");
}
Output is the following:
da-DK
$2.00
8/30/2007 5:14:02 PM
Since currentCulture is "da-DK" i would have expected the something
like the following:
kr 2.00
30-08-2007
This is in fact the result coming from the servers that are working.
How come the Culture is not formatting the values correctly?
Thanks for the help..
That displays en-US, but as far as i know, that does not affect
formatting?

Aug 30 '07 #3
On 30 Aug., 17:48, Basildk <Thomasboniel...@gmail.comwrote:
On 30 Aug., 17:30, "Patrice" <http://www.chez.com/scribe/wrote:
What if you display CurrentUICulture ?
---
Patrice
"Basildk" <Thomasboniel...@gmail.coma écrit dans le message de news:
1188487053.814585.41...@22g2000hsm.googlegroups.co m...
Hi.
I have a strange problem. We have an asp.net application running on
several server with different setups.
On 2 of our servers we experience that the globalization settings are
misbehaving.
We have boiled the problem down to this: (exemplified by a very simple
page)
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(Thread.CurrentThread.CurrentCulture .Name + "<br />");
Response.Write(2.ToString("c", Thread.CurrentThread.CurrentCulture) +
"<br />");
Response.Write(DateTime.Now.ToString() + "<br />");
}
Output is the following:
da-DK
$2.00
8/30/2007 5:14:02 PM
Since currentCulture is "da-DK" i would have expected the something
like the following:
kr 2.00
30-08-2007
This is in fact the result coming from the servers that are working.
How come the Culture is not formatting the values correctly?
Thanks for the help..

That displays en-US, but as far as i know, that does not affect
formatting?
I just tried setting CurrentUICulture to "da-DK", but with the same
result..

Aug 30 '07 #4
On 30 Aug., 17:51, Basildk <Thomasboniel...@gmail.comwrote:
On 30 Aug., 17:48, Basildk <Thomasboniel...@gmail.comwrote:
On 30 Aug., 17:30, "Patrice" <http://www.chez.com/scribe/wrote:
What if you display CurrentUICulture ?
---
Patrice
"Basildk" <Thomasboniel...@gmail.coma écrit dans le message de news:
1188487053.814585.41...@22g2000hsm.googlegroups.co m...
Hi.
I have a strange problem. We have an asp.net application running on
several server with different setups.
On 2 of our servers we experience that the globalization settings are
misbehaving.
We have boiled the problem down to this: (exemplified by a very simple
page)
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(Thread.CurrentThread.CurrentCulture .Name + "<br />");
Response.Write(2.ToString("c", Thread.CurrentThread.CurrentCulture)+
"<br />");
Response.Write(DateTime.Now.ToString() + "<br />");
}
Output is the following:
da-DK
$2.00
8/30/2007 5:14:02 PM
Since currentCulture is "da-DK" i would have expected the something
like the following:
kr 2.00
30-08-2007
This is in fact the result coming from the servers that are working.
How come the Culture is not formatting the values correctly?
Thanks for the help..
That displays en-US, but as far as i know, that does not affect
formatting?

I just tried setting CurrentUICulture to "da-DK", but with the same
result..
I researched a little further:
If i insert the following code:
Response.Write("Language " + cultureInfo.Name + "<br />");
Response.Write("---------------------------------<br />");
Response.Write("CurrencySymbol " +
cultureInfo.NumberFormat.CurrencySymbol.ToString() + "<br />");
Response.Write("DateSeparator " +
cultureInfo.DateTimeFormat.DateSeparator + "<br />");
Response.Write("LongDatePattern " +
cultureInfo.DateTimeFormat.LongDatePattern.ToStrin g() + "<br />");
Response.Write("ShortDatePattern " +
cultureInfo.DateTimeFormat.ShortDatePattern.ToStri ng() + "<br />");
string[] days = cultureInfo.DateTimeFormat.DayNames;
for( int i = 0; i < days.Length; i++)
{
Response.Write(days[i] + "<br />");
}
Response.Write("---------------------------------<br />");
I get the following output:

Language da-DK
---------------------------------
CurrencySymbol $
DateSeparator /
LongDatePattern dddd, MMMM dd, yyyy
ShortDatePattern M/d/yyyy
søndag
mandag
tirsdag
onsdag
torsdag
fredag
lørdag

In other words: Some of the values are perfect danish (the days) while
others are stille american (datepattern, dateseperator and
currencySymbol)
I am puzzled:)

Aug 30 '07 #5
Yeah just random thoughts & tries for now...

What if you try a *Windows* .NET based application on the server that you'll
run under a regular account. Do you have the same result ? In case it would
work what if you make your ASP.NET application run under the same account ?

I'm not sure how .NET get these info (my understanding at least for 2.0
would be that they are build right into the framework ??). If the FW uses
system files to get those info then it could be a system level problem with
nls support files and I belive I saw once this in classic ASP and it was a
profile related issue...

--
Good luck, sorry for the poor help
"Basildk" <Th*************@gmail.coma écrit dans le message de news:
11**********************@o80g2000hse.googlegroups. com...
On 30 Aug., 17:51, Basildk <Thomasboniel...@gmail.comwrote:
On 30 Aug., 17:48, Basildk <Thomasboniel...@gmail.comwrote:
On 30 Aug., 17:30, "Patrice" <http://www.chez.com/scribe/wrote:
What if you display CurrentUICulture ?
---
Patrice
"Basildk" <Thomasboniel...@gmail.coma écrit dans le message de news:
1188487053.814585.41...@22g2000hsm.googlegroups.co m...
Hi.
I have a strange problem. We have an asp.net application running on
several server with different setups.
On 2 of our servers we experience that the globalization settings
are
misbehaving.
We have boiled the problem down to this: (exemplified by a very
simple
page)
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(Thread.CurrentThread.CurrentCulture .Name + "<br />");
Response.Write(2.ToString("c", Thread.CurrentThread.CurrentCulture)
+
"<br />");
Response.Write(DateTime.Now.ToString() + "<br />");
}
Output is the following:
da-DK
$2.00
8/30/2007 5:14:02 PM
Since currentCulture is "da-DK" i would have expected the something
like the following:
kr 2.00
30-08-2007
This is in fact the result coming from the servers that are working.
How come the Culture is not formatting the values correctly?
Thanks for the help..
That displays en-US, but as far as i know, that does not affect
formatting?

I just tried setting CurrentUICulture to "da-DK", but with the same
result..
I researched a little further:
If i insert the following code:
Response.Write("Language " + cultureInfo.Name + "<br />");
Response.Write("---------------------------------<br />");
Response.Write("CurrencySymbol " +
cultureInfo.NumberFormat.CurrencySymbol.ToString() + "<br />");
Response.Write("DateSeparator " +
cultureInfo.DateTimeFormat.DateSeparator + "<br />");
Response.Write("LongDatePattern " +
cultureInfo.DateTimeFormat.LongDatePattern.ToStrin g() + "<br />");
Response.Write("ShortDatePattern " +
cultureInfo.DateTimeFormat.ShortDatePattern.ToStri ng() + "<br />");
string[] days = cultureInfo.DateTimeFormat.DayNames;
for( int i = 0; i < days.Length; i++)
{
Response.Write(days[i] + "<br />");
}
Response.Write("---------------------------------<br />");
I get the following output:

Language da-DK
---------------------------------
CurrencySymbol $
DateSeparator /
LongDatePattern dddd, MMMM dd, yyyy
ShortDatePattern M/d/yyyy
søndag
mandag
tirsdag
onsdag
torsdag
fredag
lørdag

In other words: Some of the values are perfect danish (the days) while
others are stille american (datepattern, dateseperator and
currencySymbol)
I am puzzled:)
Aug 31 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1722
by: Giulio Santorini | last post by:
Hi, I've got two drop down list controls. When I select a value from the first one I fill the second one. And when I select a value from the second one I would like to fill another control. But...
3
11700
by: Reney | last post by:
I am using Access Database in my program. The column in the table that I am going to use has date/time value with Medium Time selected. (HH:mm). The program is recording a clock in time to this...
11
7168
by: Cor Ligthert | last post by:
Hello everybody, Jay and Herfried are telling me every time when I use CDate that using the datetime.parseexact is always the best way to do String to datetime conversions. They don't tell why...
4
2582
by: anonymike | last post by:
Hello, I'm working on an ASP.NET project (VS 2005) utilizing an Oracle database backend. While I understand that Gridview's are a breeze to work with using SQL Server (hundreds of sites point...
1
2724
by: r1100r98 | last post by:
I am having a problem moving the data from a datatable to the SQL2005 table (using VB2005). See code below. The SQL2005 table is empty, the datatable is being filled from a text file, not from...
2
5811
by: tshad | last post by:
I have been using a schema.ini file to define the columns of my .csv files that has been working fine. But I just tried one where it doesn't work. I have the following schema.ini file: ...
0
1922
by: mcasey0827 | last post by:
I'm writing a little app to get data from a CSV file generated everyday by a vendor and insert it into a Table in our SQL Server database. I can get the data fine, and I can easily merge it with...
20
3104
by: Charles | last post by:
Hello, On my web site, I have a <selectdrop-down menu that allows to show/ hide divs: http://tchernobyl.dreamhosters.com - The problem is that it doesn't work in IE7 (only tested in Opera and...
1
1512
by: ready2explod | last post by:
Hi Friends, I am new to .NET and need your help to sort out one issue. I want to change the language of my program using following code: ...
0
3027
by: Sparkiee | last post by:
Hi, A lil bit of help required from you guys, I am trying to make a windows service that will also focus on globalization, the problem i am facing is when i am trying to put globalization code in...
0
7192
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7445
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4991
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1492
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.