problems with culture / .net installation en-GB

  • Thread starter Thread starter David Mc
  • Start date Start date
D

David Mc

We recently installed the 1.1 redist of .Net on a new server. Only
after installing .Net did I realize that the regional settings of the
server had not been localized.

The application we have written uses GB style dates i.e. dd/mm/yyyy.
When running new server we were getting error message - i.e. incorrect
date format. First we removed the app and .net, reset the locale,
rebooted and re-installed everything. However server still defaulting
to US dates. So we have now edited web.config and set culture="GB-en"
uiculture="GB-en". The app is now no longer complaining about the date
format, but it is still using US default days - i.e Sunday=7 rather
than sunday=1. This does not seem to be impacted by changing the
culture in web.config.

I have two questions. (1) why does .Net continue to believe that it
should use US format even though the regional settings on the server
have been changed - I have reset looked through the registry but could
not identify a problem key. The machine.config shows culture=neutral
for all entries.

(2) Where do the US day numbers comefrom. Is there some way of setting
these in web.config.

Many thanks for help.
Davud
 
What exactly is the expression that returns 7 ?

In particular note of course that enums for the days of the week won't
change. What change is the property that defines the first day of the week.
Try :
System.Threading.Thread.CurrentThread.CurrentCulture = New
System.Globalization.CultureInfo("en-US")

Response.Write(System.Threading.Thread.CurrentThread.CurrentCulture.DateTime
Format.FirstDayOfWeek)

System.Threading.Thread.CurrentThread.CurrentCulture = New
System.Globalization.CultureInfo("en-GB")

Response.Write(System.Threading.Thread.CurrentThread.CurrentCulture.DateTime
Format.FirstDayOfWeek)




Patrice
 
Hi Patrice,


The code you supplied returns Sunday/Monday in that order which is
strange as it implies that the first day of the week for the en-US is
Sunday and For en-GB Monday. I am asking the developers for access to
the source code. So that I can see what is going on. Many thanks for
replying to my mail. I will post again when I have the source.

Dave


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Do you mean it shouldn't . AFAIK the fisrt day of the week is Monday in US.
Not sure for GB.

The 7 sounds really strange to me as the days enumeration for .NET renges
aFAIK from 0 (Sunday) to 6

Patrice
 
Patrice,

Problem now resolved, many thanks for your help. I did pull up and
plough through the code - it was a little hard to follow - but that
was not the issue. The problem was that when the Oracle client
software was installed it took it NLS_LANG from the system locale of
the NT server. Thus when aspnet made a connection to Oracle it was
explicitly setting NLS_LANG etc for its session. Changing the
registry entry in HKLM.Software.oracle.home0 from american to uk
english sorted it out.

Thanks Again.
Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top