problem converting strings to dates - 08-23-2004 , 12:07 AM
I've been writing a program in .net for a couple years and everything
was working fine until my hard drive had to be replaced and so I installed
visual studio on the new drive and loaded up my application. Now I get the
following error whenever I try to convert a string into a date:
An unhandled exception of type 'System.InvalidCastException' occurred in
Additional information: Cast from string "12/31/2022" to type 'Date' is not
This never happened before and I don't have any idea what is causing it.
Any suggestions would be much appreciated. Thanks.
RE: problem converting strings to dates - 08-24-2004 , 04:49 PM
this is C# code, but you can translate it to VB:
//define startDate as DateTime, also txtStartDate.Text is a string from a
startDate = Convert.ToDateTime(txtStartDate.Text);
//hope this helps, Al
|Thread Tools||Search this Thread|