473,387 Members | 1,798 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,387 software developers and data experts.

date cast error in asp.net page

In an asp.net page that uses a cast function to convert a date, the code
works in a development environment but in production it displays the
following error.

Cast from string "31/03/2005" to type 'Date' is not valid.

Both are Windows 2003 servers I have check the regional settings which are
both English (United Kingdom).

Are there any other settings that I need to check?
Nov 18 '05 #1
2 1643
had a similar problem, works on my project with:

System.IFormatProvider format = new
System.Globalization.CultureInfo("en-UK", true);
DateTime.Parse("sting2Parse", format);

On Fri, 20 Aug 2004 20:01:32 +0100, Robin <ro*******@hotmail.com> wrote:
In an asp.net page that uses a cast function to convert a date, the code
works in a development environment but in production it displays the
following error.

Cast from string "31/03/2005" to type 'Date' is not valid.

Both are Windows 2003 servers I have check the regional settings which
are
both English (United Kingdom).

Are there any other settings that I need to check?


--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 18 '05 #2
I found that adding a culture="en-GB" to the globalization part of the
web.config worked.

"Mike Craggs" <mi************@world-direct.at> wrote in message
news:op**************@michaelc.world-direct.at...
had a similar problem, works on my project with:

System.IFormatProvider format = new
System.Globalization.CultureInfo("en-UK", true);
DateTime.Parse("sting2Parse", format);

On Fri, 20 Aug 2004 20:01:32 +0100, Robin <ro*******@hotmail.com> wrote:
In an asp.net page that uses a cast function to convert a date, the code
works in a development environment but in production it displays the
following error.

Cast from string "31/03/2005" to type 'Date' is not valid.

Both are Windows 2003 servers I have check the regional settings which
are
both English (United Kingdom).

Are there any other settings that I need to check?


--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

Nov 18 '05 #3

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

Similar topics

0
by: Bijoy Naick | last post by:
Hello, MySQL Version = 3.23.46 I am working with a table which has a date field but type is varchar. This cannot be changed. I don't have control over this. I need to run a set of queries...
7
by: Niall Porter | last post by:
Hi all, I'm building an ASP app on a Windows 2000/IIS machine which interfaces with our SQL Server 2000 database via OLE DB. Since we're based in the UK I want the users to be able to type in...
15
by: David | last post by:
Hi, I have built a web application that will be a very high profile application. We had tested it, demonstrated it and shown that it all works. On a dress rehearsal run through, it failed...
2
by: ed | last post by:
I read a similar post on the group : http://groups.google.co.uk/groups?q=.net+cast+string+date+valid+sql&start=10&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=eRvILbWECHA.1548%40tkmsftngp05&rnum=15 I'm...
15
by: Khurram | last post by:
I have a problem while inserting time value in the datetime Field. I want to Insert only time value in this format (08:15:39) into the SQL Date time Field. I tried to many ways, I can extract...
11
by: Karl O. Pinc | last post by:
Hi, What's the best way to obtain the Julian day from a postgresql date? PostgreSQL 7.3.4 on i386-redhat-linux-gnu, compiled by GCC i386-redhat-linux-gcc (GCC) 3.2.2 20030222 (Red Hat Linux...
3
by: R Reyes | last post by:
Error: Unable to cast object of type 'ASP.CompanyDirectory_aspx' to type 'CompanyDirectory'. Code: clsCompanyDirectory = (CompanyDirectory)Context.Handler;...
2
by: syntego | last post by:
We commonly use triggers to log changes to our main tables to historical log tables. In the trigger, we create a concatenated string of the old values by casting them as follows: ...
8
by: nartla | last post by:
Hello, I work in an application in VBA/Access, which connects to an SQL Server database via ODBC. I am trying to run a SQL command to the SQL Server, but I have some data problems : My...
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.