Saturday, March 31, 2012

String to date error

Hi guys Ive got a slight problem..

When i run my asp.net page through visual studio the application works fine, however when i puslish it and view it over myhttp://localhost page i get the following error "Conversion from string "28/8/2007" to type 'Date' is not valid." when selecting dates from a calendar control i created.

Im thinking this is some formatting issue having to do with EU/US Date format, however im not too sure about it and with a few research there are some help files stating to use globalization and once again im not sure how that works.

What im doing is assigning a date within an arraylist (which are of type dates) to a Date variable as below

Dim tempDate asDatetempDate = NewDate.Item(0) // arraylist of containing dates
Would appreciate some help regarding this issue

Thanks :)

It is a en-eu related problem. This article should help

http://msdn2.microsoft.com/en-us/library/2h3syy57.aspx
thanks that was interesting, also found out that the root to the problem was due to regional settings under the aspnet user account, my currently logged on account was set to UK however the user account aspnet was still on US therefore it kept showing dates in US format

0 comments:

Post a Comment