You cant just stuff one data type into a variable of another without converting. Some of the code won't compile under Option Strict, because it tries to do just that:
Dim cdr_date As DateTime = reader.GetDateTime(0).ToString()
It sounds like you are trying to strip the time from a db var, so get it as a DateTime then if you must use it as string somewhere convert it:
Dim myDT As DateTime
rdr.Read()
' these do the same thing - get it as date:
myDT = Convert.ToDateTime(rdr("zDateTime"))
myDT = rdr.GetDateTime(0)
A DateTime will always have a Date and a Time. To ignore the Time, use something like "MM/dd/yyyy" to ignore it either when displaying it or converting to string. SubString and the magic number of 10 is not needed.
TextBox13.Text = myDT.ToString("MM/dd/yyyy")
Or to save to a string variable:
Dim notADate As String
' from a DB Reader:
notADate = rdr.GetDateTime(0).ToString("MM/dd/yyyy")
' in general:
notADate = myDT.ToString("MM/dd/yyyy")
However, this: unable to convert datetime to system datetime indicates something else it wrong. The DB Provider object is apparently unable to convert the db data to a NET DateTime Type. The most likely cause is bad data.
Rather than null, MySQL can be told to store 01/01/0001 00:00:00 as a 'zero date". For this, you may need to modify your connection string to append this:
"server=....;convertzerodatetime=True;allowzerodatetime=True"
These enable the storing and conversion of otherwise illegal DateTime values. AllowZeroDateTime in particular will return a zero date time rather than throw an exception. In this case (resolved in comments), since the return was a Zero Date but not what what seen in the DB, deleting it and creating a new row resolved it.
There are many, many other options for the MySQL connection:
MySQL ConnectionString options
Datebut when running a select query, in vb.net for some reason its showing asDateTimeas it will return the date and then00:00:00so i am just trying to get the date, but its fine getting it as a string. once selected it no longer needs to be aDate