date exception - vb.net
Posted on 2014-08-05
I am using the following statement on one of the page and I get an error sometimes if the user is outside the GB format
Dim Query As String = "UPDATE IQResults SET IsCompleted='True', EndTime=GetDate() Where resultid =(SELECT max(resultid) FROM IQResults where CustomerID='" & CustomerID & "')"
Dim MyCommand As SqlCommand = New SqlCommand(Query, MySqlConnection)
pnlTestComplete.Visible = True
>>InvalidCastException: Conversion from string "26/03/1991" to type 'Date' is not valid.
Can someone please advice how can I fix this?