"Cast from string "" to type 'Date' is not valid" error


Hi,
I solved a "Error converting data type nvarchar to datetime" problem with the help of this forum. The thing simply was to convert a date, say StartDate to Ctype(StartDate, Date).
Now that I did this for all dates in the AdminDB.vb file, I get the following error while trying to remove Expiry Date from Site Settings : Cast from string "" to type 'Date' is not valid
How can I correct this ?
thanks for your help
Johann
Website - Weblog
0
jfrot
11/25/2003 5:39:15 PM
asp.net.dotnetnuke 25171 articles. 0 followers. Follow

2 Replies
881 Views

Similar Articles

[PageSpeed] 15


I'm stuck here !
Now I can use dates in the correct format, but cannot update Site Settings with an empty Expiry Date, nor create a new portal, since Expiry Date is empty on portal creation.
Please help
Johann
Website - Weblog
0
jfrot
11/26/2003 4:00:24 PM
Well, I had same problem with Banner's Start Date and End Date, this is what I suggest You:

Dont' use IIf(...) but something like this:
Dim MyExpiryDate
If ExpiryDate = "" Then
MyExpiryDate = SqlInt16.Null
Else
MyExpiryDate = CType(ExpiryDate, Date)
End If
Lemme know how it goes!
0
diamante_ct
11/28/2003 3:11:39 PM
Reply: