I retrieve a table from the database that contains a column of type "time" in sql server, and I try to assign this to a DateTime variable but i get this error: System.InvalidCastException: Specified cast is not valid.
here's my c# code:
DateTime StartTime = (DateTime)dt.Rows[i]["startTime"];
knowing that the column "startTime" is of type "time" and I can change it in the database. any help??