Exception: Specified cast is not valid
Can any1 tell me why the below line throws an exception?
if ((DateTime.Now.TimeOfDay.CompareTo(((DateTime)RowSchedule["StartEnter"]).TimeOfDay) >= 0) && (DateTime.Now.TimeOfDay.CompareTo(((DateTime)RowTurno["LimiteEnter"]).TimeOfDay) <= 0))
The RowSchedule is a DataRow that retrieve the data from a Table from a DataSet. The table have 6 DateTime columns.
This is the excepton:
System.InvalidCastException
Additional information: Specified cast is not valid.
Can any1 tell me what is wrong?
Thax in advance.
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

itaym0266 reputationPosted Oct 13, 2004, 11:24 PM EDT
Carlos SanchezRank #6,113 · 276 reputationPosted Oct 18, 2004, 9:53 AM EDT
johnbill200421 reputationPosted Oct 26, 2004, 12:47 AM EDT