0

im trying to convert my date from MySQL to a textbox.text and its giving the msg
unable to convert MySQL date/time value to system.datetime

dim tempdate as date

 TempDate = dr.Item("dob").ToString
                txtDate.Text = TempDate.ToString

someone please help

2
Contributors
4
Replies
14
Views
5 Years
Discussion Span
Last Post by rc_new
0

still giving me the same error message. is there any other method?

0

What does dr.Item("dob").ToString returns?

If dr.Item("dob") is a valid date, this should work:

TempDate = new Date(dr.Item("dob").ToString("yyyy-MM-dd"))
txtDate.Text = TempDate.ToString("yyyy-MM-dd")

Edited by AleMonteiro

0

solved

added the following on the connection string

Convert Zero Datetime=True" & "Allow Zero Datetime=True

thanx alot

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.