rmartes
asked on
VB.Net Timespan to String
Hi Experts,
I'm trying to display data from a MySqlDataReader. One of the returned values is a timespan in the following format (00:00:00). However, I keep getting the following error:
Conversion from type 'TimeSpan' to type 'String' is not valid.
I googled and found some articles, but still getting error.
Here is what I have so far:
How can I convert the above timespan (00:00:00) into a string???
Thanks
I'm trying to display data from a MySqlDataReader. One of the returned values is a timespan in the following format (00:00:00). However, I keep getting the following error:
Conversion from type 'TimeSpan' to type 'String' is not valid.
I googled and found some articles, but still getting error.
Here is what I have so far:
Dim ts As TimeSpan
Dim dnd As String
If (Not dbReader.IsDBNull(dbReader.GetOrdinal("time_in_do_not_disturb"))) Then
ts = TimeSpan.Parse(dbReader("time_in_do_not_disturb")) 'this line doesn't work
dnd = String.Format("{hh\\:mm\\:ss}", ts)
Else
End If
How can I convert the above timespan (00:00:00) into a string???
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad to help :-)
ASKER