Netnoobie
Well-known member
So I have a column in a MySQL table that is "Time". OK...when I write a simple query like:
The item updates properly, the birds sing, and the sky is sunny. However, nothing I try in ASP.NET works, and I get this error:
System.InvalidCastException: Specified cast is not valid. at System.Data.Common.TimeSpanStorage.Set(Int32 record, Object value) at System.Data.DataColumn.set_Item(Int32 record, Object value)Couldnt store <3:49:41 PM> in TimeOut Column. Expected type is TimeSpan.
So whats the deal with this? Im adding a row to a DataGrid and I get this error. Is this occuring in the database even? Ive tried about every single thing I could think of to format the time and it always fails. We just switched this application over from SQL Server and Im having to hook everything back up again with minimal success it seems.
Any help would be greatly appreciated.
Cheers!
Code:
UPDATE Daily
Set TimeOut = 3:14:40 PM
Where DailyID = 8
System.InvalidCastException: Specified cast is not valid. at System.Data.Common.TimeSpanStorage.Set(Int32 record, Object value) at System.Data.DataColumn.set_Item(Int32 record, Object value)Couldnt store <3:49:41 PM> in TimeOut Column. Expected type is TimeSpan.
So whats the deal with this? Im adding a row to a DataGrid and I get this error. Is this occuring in the database even? Ive tried about every single thing I could think of to format the time and it always fails. We just switched this application over from SQL Server and Im having to hook everything back up again with minimal success it seems.
Any help would be greatly appreciated.
Cheers!