Cast from string "27-06-2008" to type 'Date' is not valid
I have a major problem, I have a working Asp.NET application running in Win2003. This setup is working perfectly without any probelm.
Now I have a new server with Win2003 R2 SP2 and I installed my asp application to this server and now I getting following error in all the pages which are having date fields. Eventhough I enter "27/06/2008" it gives me following error
Cast from string "27/06/2008" to type 'Date' is not valid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Cast from string "27/06/2008" to type 'Date' is not valid.
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[InvalidCastException: Cast from string "27/06/2008" to type 'Date' is not valid.]
Microsoft.VisualBasic.CompilerServices.DateType.FromString(String Value, CultureInfo culture) +162
Microsoft.VisualBasic.CompilerServices.DateType.FromString(String Value) +53
Microsoft.VisualBasic.CompilerServices.DateType.FromObject(Object Value) +156
SharjahVisa.SearchList.Page_Load(Object sender, EventArgs e) +526
System.Web.UI.Control.OnLoad(EventArgs e) +67
Version Information: Microsoft .NET Framework Version:1.1.4322.2379; ASP.NET Version:1.1.4322.2379
All my three servers are set to dd/MM/yyyy format in reginal settings with Indonesia as country. But the same application working fine in other server (same configuration).
I've tried to set the date setting in regional setting to MM/dd/yyyy and I get the same error.
This there any setting in OS, IIS or ASP.NET I should set to fix this problem?
By athomas42 in forum .NET
Last Post: 06-25-2007, 05:54 PM
By Marcos in forum VB Classic
Last Post: 01-25-2006, 12:18 PM
Last Post: 10-03-2005, 12:57 AM
By mdengler in forum ASP.NET
Last Post: 11-26-2002, 03:32 PM
By Chandra in forum VB Classic
Last Post: 06-22-2000, 08:30 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL