This is a migrated thread and some comments may be shown as answers.

Unable to cast object of type 'System.TimeSpan' to type 'System.IConvertible'

3 Answers 1340 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Dan Reese
Top achievements
Rank 1
Dan Reese asked on 18 Mar 2008, 03:39 PM
I'm using a MySql SqlDataSource with the Rad Scheduler.

I loaded the page with the scheduler and clicked to add a new event, clicked insert and when the page reloaded I got this error:

Unable to cast object of type 'System.TimeSpan' to type 'System.IConvertible'.

I looked in the database and it inserted everything properly, but it looks like it cannot convert my start_time, end_time columns for the select of the Scheduler. 

Any ideas on how to make this work?

3 Answers, 1 is accepted

Sort by
0
Dimitar Milushev
Telerik team
answered on 18 Mar 2008, 05:07 PM
Hi Dan Reese,

Can you please open a support ticket and send us a sample project (along with a database) that reproduces the issue? This will greatly aid us in diagnosing the problem and providing a solution sooner.

Thank you for your understanding.

Kind regards,
Dimitar Milushev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Dan Reese
Top achievements
Rank 1
answered on 18 Mar 2008, 08:02 PM
I realized that the column type was "timestamp" I changed to "DateTime" but now I am getting an error that it cannot convert MySql.DateTime to System.DateTime.
0
Accepted
Peter
Telerik team
answered on 19 Mar 2008, 12:03 PM
Hello Dan,

Here are some online aricles which discuss the problem and suggest possible workarounds:

http://www.tjitjing.com/blog/2007/04/unable-to-convert-mysql-datetime-value.html

http://lists.mysql.com/dotnet/295

http://mdid.org/mdidwiki/index.php?title=Talk:Unable_to_convert_MySQL_date/time_value_to_System.DateTime_exception



All the best,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
Dan Reese
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
Dan Reese
Top achievements
Rank 1
Peter
Telerik team
Share this question
or