Last post Feb 13, 2007 10:09 AM by ps2goat
Feb 13, 2007 06:21 AM|vishalsharma.net|LINK
i am working in .net 1.1 and i am working on a web service. it 's working fine in .net 1.1 with vs2003 but when i migrated my WS from .net 1.1 to .net 2.0 i am getting System.FormatException while converting datetime from string using DateTime.Parse method.
it was not happening earlier when i was using .net 1.1. My WS converted from vs2003 to vs2005 using a wizard and it doesn's shows a single error.
i did lots of googling on this issue but didnot gets any help ,
so any reply in the matter will be highly appericiable.
Feb 13, 2007 10:09 AM|ps2goat|LINK
What format was your String in when you are trying to convert it? I.e., "3/12/2007", "March 12, 2007", "3/12/2007 1:45:02 PM".
As a quick workaround, try
Dim myDate As DateTime
Dim myString As String
myString = "3/12/2007"
myDate = cdate(myString)
' or try:
myDate = DirectCast(myString, DateTime)