473,383 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Culture settings and threads

gchq
96
Hi there

I've come across an odd one! Running a sub as a seperate thread it is thowing an exception when it hits

Dim vInvDate as Date = TextBox10.Text

Conversion to string "08/21/2007" to type date is not valid!

If I change this to:-

Dim vInvDate as Date = Date.Parse(TetBox10.Text) it thows a 'not a valid date' exception.

Since the code runs fine on the 'main' thread I can only assume that in the process of running a new thread the culture settings in the web.config file are ignored and it's reverting back to the main computer settings! (In this case UK).

Has anyone encountered this before? Is there a workaround?

Thanks
Aug 22 '07 #1
2 1177
gchq
96
Found a way round that problem:-

thread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCul ture("en-US")

Before the thread.Start() event

Now I've hit another issue - one I'm not sure where to start at!

Dim sString As String = Request.ServerVariables("APPL_PHYSICAL_PATH")

Is throwing a "Request is not available in this context" exception!

Sigh
Aug 22 '07 #2
gchq
96
Found a way round that - before the create thread event, insert the value into a textbox (visible = false) and then get the value from the textbox once the thread is running - a little messy but it works. If anyone knows a cleaner way to do this please let me know!

I now at least have a progress bar running in a web app!
Aug 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Benny | last post by:
Hi, My application creates a number of aync threads....i want to make sure that all these threads are of the invariant culture. So, how do i ensure that whenever a new thread is created in my...
2
by: Aliasgar Pocketwala | last post by:
Hi, I have an asp.net application that is using the wrong culture. I cant figure out where does it get its setting from. My web application runs as a specific user since so that I can give it...
3
by: Ashish | last post by:
I have a application in which culture settings are customizable, they dont depend on the machine settings on which the application is running, I need to make sure that all the threads running in...
1
by: Ya Ya | last post by:
I am developing a DLL (class library) for a web application of mine. In the web.config of the web application I have set: culture="en-GB" uiCulture="en" in order that the date format will be...
2
by: Lars Netzel | last post by:
Somone told me that you should always take care of Culture settings in the application by setting a Culture ISO thing on some Thread that ASP is runing on.. so that decimals and thousand separators...
9
by: Edge | last post by:
hi, I am saving the user selected culture in a session variable so I can apply it back to all pages when refreshed and then load the proper .resx values. For that I am using global.asax
1
by: schaf | last post by:
Hi NG ! I set the CurrentCulture and the CurrentUICulture at the start of my app using this code: string sUICulture = System.Configuration.ConfigurationSettings.AppSettings; if (sUICulture !=...
4
by: adi | last post by:
Hi I'm using .NET Framework 1.1 My application needs to read the system's language settings. How to do this? Thanks.
0
by: kidders | last post by:
Seem to be having problems with the en-GB culture/uiCulture setting, its making dates a format of the incorrect MM/dd/yyyy. I've searched the groups on this issue, here is a lengthy thread, where...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.