How to change the current thread current culture at run time.

Posted: 07-20-2003, 02:47 PM


I have created a new culture :
Dim objCulture As New CultureInfo("he") //hebrew

When I tried to assign it to the current thread.

Thread.CurrentThread.CurrentCulture = objCulture
Thread.CurrentThread.CurrentUICulture = objCulture


This Caused an exception :
" Culture "he" is a neutral culture. It can not be used in
formatting and parsing and therefore cannot be set as the
thread's current culture. "


what is the problem ?

Reply With Quote

Responses to "How to change the current thread current culture at run time."

Natty Gur
Guest
Posts: n/a
 
Re: How to change the current thread current culture at run time.
Posted: 07-20-2003, 03:27 PM
Hi,

The right way to set neutral culture is by using CreateSpecificCulture
static function :

System.Threading.Thread.CurrentThread.CurrentCultu re =
System.Globalization.CultureInfo.CreateSpecificCul ture("he");

Neutral cultures are cultures that just the language set, without the
location.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply With Quote
 
LinkBack Thread Tools Search this Thread Display Modes
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving current date and time in ASP and ACCESS Anthony Brown Dreamweaver AppDev 5 04-19-2005 05:20 PM
Either BOF or EOF is True, or the current record hasbeen deleted. Requested operation requires a current record Choole Dreamweaver AppDev 3 03-09-2005 04:19 PM
Change style of a single row of the item list of datagrid, based on a field value of current item... QUASAR ASP.NET Data Grid Control 6 01-17-2004 06:46 PM
HttpContext.Current.User vs. Thread.CurrentPrincipal Michael Ames ASP.NET Security 1 11-14-2003 05:47 AM
Could not instantiate ActiveX control because the current thread is not in a si Karthey ASP Components 0 07-01-2003 04:36 PM