Re: date rendered differently on two computers with same regional settings

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Aug 9, 10:05 am, "Mark" <m...@xxxxxx> wrote:
This is the complete message i get:

Server Error in '/myappl' Application.
---------------------------------------------------------------------------­-----

Conversion from string "13-08-07" 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: Conversion from string
"13-08-07" to type 'Date' is not valid.

Source Error:

Line 17: datbeg = e.NewValues("datbeg")
Line 18: datend = e.NewValues("datend")
Line 19: lec2 = e.NewValues("lector2")
Line 20: e.NewValues("datbeg") = String.Format("{0:yyyy.MM.dd}",
datbeg)

Source File: C:\Inetpub\wwwroot\myapp\test.aspx.vb Line: 18

Stack Trace:

[InvalidCastException: Conversion from string "13-08-07" to type 'Date' is
not valid.]


Just a quick though on this,

try to use ParseExact

yourdateobj = DateTime.ParseExact("13-08-07", "dd-MM-yy",
System.Globalization.CultureInfo.InvariantCulture)

or use an appropriate culture




.



Relevant Pages

  • system.web.mail.StmpMail problem
    ... SmtpMail.Sendit throws this exception: ... the current web request. ... Please review the stack trace for more ...
    (microsoft.public.dotnet.framework.aspnet)
  • Loading managed DLL
    ... 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. ...
    (microsoft.public.dotnet.framework.aspnet)
  • ADO Novice
    ... 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. ...
    (microsoft.public.dotnet.framework.adonet)
  • Load managed DLL
    ... 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. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: getting asp pages to display Database results
    ... 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. ...
    (microsoft.public.inetserver.iis)