I have a MySQL database with a TIME field (not DateTime, not Date)
After getting the data into a DataTable I want to select records from the DataTable that are at a specific time.
MyTime is a DateTime object
<Example Code>
DataRow[] TodaysAppointments = tblAppointments.Select("Time_Start = '"+ MyTime.TimeOfDay +"'");
This produces the error:
"Cannot perform '=' operation on System.TimeSpan and System.String."
So I tried making a TimeSpan object instead like so:
DataRow[] TodaysAppointments = tblAppointments.Select("Time_Start = '"+ TimeSpan.Parse(MyTime.TimeOfDay.ToString()) +"'");
This produces the error:
Cannot perform '=' operation on System.TimeSpan and System.String.
</Example Code>
If you have any ideas or solutions please let me know. I hope this isn't a bug.
DarthMod
Community Support Moderator