0

I am using this code in my vb.net app:

If reader3.GetString(6).ToString = "0000-00-00" Then
    product_detail_from_date = ""
Else
    product_detail_from_date = Convert.ToDateTime(reader3.GetString(6)).ToString("dd/MM/yyyy")
End If

on this occasion, reader3.getstring(6) does equal 0000-00-00

Unable to convert MySQL date/time value to System.DateTime

how can i stop this error showing and get the code working with the IF statement?

Ňɏssa Pøngjǣrdenlarp
  • 38,411
  • 12
  • 59
  • 178
charlie
  • 115
  • 2
  • 11

0 Answers0