Conversion from type 'DBNull' to type 'String' is not valid. What kind of an error is it?

173 Views Asked by At

I Have a Form which takes input of Applied date And changed date. I'm Sending Changed Date NULL as for now. the code inserts the data properly but shows this error on screen "Conversion from type 'DBNull' to type 'String' is not valid"

I'm using this Function for Date input

If ChangedDate <> "" Then
    sSQL = sSQL & ", @ChangedDate= " & gFixQuotes(Format(DateTime.Parse(ChangedDate, InputFormat), SQLLONGDATEFORMAT))
Else
    sSQL = sSQL & ", @ChangedDate=NULL"
End If
0

There are 0 best solutions below