Pass your date to this function and it will work fine.
Function ISODate(ByVal dteDate As Date) As String
If IsDate(dteDate) = True Then
Dim dteDay, dteMonth, dteYear
dteDay = dteDate.Day
dteMonth = dteDate.Month
dteYear = dteDate.Year
ISODate = dteYear & _
"-" & Right(CStr(dteMonth + 100), 2) & _
"-" & Right(CStr(dteDay + 100), 2)
Else
ISODate = Nothing
End If
End Function
--
Dino Buljubasic
Software Developer
http://rivusglobal.com
"Ryanfai" <ry*****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I use the vb.net make the program that save the date and any Information
field.
when I input the date in textbox then I save to database occurs error that
is
"Cast from string "20/08/2003" to type 'Date' is not valid.
I use this command change string to Date
dim year as date
dim strYear as string
=> year = ctype(stryear,Date).ADDYEAR(2)
I only in Windows 98 have problem
but In windows XP is not problem.
What wrong, and how can solve this problem and this commands have any
error?