Error: String was not recognized as a valid DateTime

  • Thread starter Thread starter database
  • Start date Start date
D

database

I AM FACING A PROBLEM WHEN I ACCESS ONE OF THE PAGES. IT USED TO WORK
BEFORE BUT AFTER RESTARTING THE APPLICATION SEVER IT GIVES THE FOLLOWING
ERROR.

- Server Error

--------------------------------------------------------------------------------

The string was not recognized as a valid DateTime. There is a unknown
word starting at index 20.

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.

Source Error:
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.


Stack Trace:

[FormatException: The string was not recognized as a valid DateTime.
There is a unknown word starting at index 20.]

System.DateTimeParse.Lex(Int32 dps, __DTString str, DateTimeToken dtok,
DateTimeRawInfo raw, DateTimeResult result, DateTimeFormatInfo& dtfi)
+1658
System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi,
DateTimeStyles styles) +334
System.DateTime.Parse(String s, IFormatProvider provider,
DateTimeStyles styles) +30
System.DateTime.Parse(String s, IFormatProvider provider) +11
System.Convert.ToDateTime(String value, IFormatProvider provider) +61
WebDateTime.clsWebDateTime.set_Text(String value)
WebDateTime.clsWebDateTime.set_Value(String value)
System.Web.UI.Contro

-
*
i tried to change the regional setting and restart the server but the
problem still there.
i changed it to dd/mm/yyyy and hh:mm:ss tt as before.

please advise me as i need the solution for urgent.*
 
I AM FACING A PROBLEM WHEN I ACCESS ONE OF THE PAGES. IT USED TO WORK
BEFORE BUT AFTER RESTARTING THE APPLICATION SEVER IT GIVES THE FOLLOWING
ERROR.

- Server Error

It might help if you show what that string was and how you were trying
to convert it to a DateTime. Also, if it's from a database: what is the
columntype?

Hans Kesting
 
Back
Top