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

Error when added new appointment

6 Answers 134 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Dave Mortgatta
Top achievements
Rank 1
Dave Mortgatta asked on 17 Apr 2012, 06:46 PM
I used code from example and got error when trying to add a new appointment.

Thank for you help...

Unable to cast object of type 'System.Guid' to type 'System.IConvertible'.Couldn't store <5303d57e-81d4-4399-9b50-cbade2462a09> in ID Column.  Expected type is Int32.

6 Answers, 1 is accepted

Sort by
0
Accepted
Dave Mortgatta
Top achievements
Rank 1
answered on 17 Apr 2012, 11:33 PM
Please disregard with this question. I followed the article here and fixed the issues.

http://www.telerik.com/help/winforms/scheduler-data-binding-binding-to-access-db-(tips-and-tricks).html


0
Stefan
Telerik team
answered on 20 Apr 2012, 03:36 PM
I am glad that you have found the right way to go. 

Should you have any other questions, do not hesitate to contact us.

Regards,
Stefan
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
Allen
Top achievements
Rank 1
answered on 03 Dec 2012, 06:48 AM
i have the same problem, i'm using int as my ID(primary, identity, increment 1) and SQLCE as my database.

My datasource is created at runtime including the Relation (so that i can display/edit Exceptions),

the error is the same as Dave mentioned. though i'm not saving any GUID. My Mappings are correct. i check, rechecked and rechecked to make sure i'm saving all of the data in the proper column with the proper datatype.

adding the appointment is fine, no errors, but after saving the appointment, the "Unable to cast object of type" is shown. the error is pointed at the Application.Run on Program.CS. so i know (i think) that may mappings are correct and that no GUID is saved into my database

How can this be solved? Thanks!

0
Ivan Todorov
Telerik team
answered on 05 Dec 2012, 03:45 PM
Hello Rhea,

This exception is likely to be thrown if you map the UniqueId property of the appointments to the ID column in the database. If you have such mapping, please try removing it. In case you need further assistance, please open a new support ticket and attach a sample project that demonstrates your case. This will let me investigate it and provide you with further support.

Let me know if I can assist you further.

Kind regards,
Ivan Todorov
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
0
Allen
Top achievements
Rank 1
answered on 06 Dec 2012, 01:58 AM
Hi Ivan,

I cannot remove my ID mapping, or the Appointments will not load.

I did not actually solved my problem, but i just returned my ID data type to accept GUID. The error does not appear anymore. But i would really prefer if my ID data type is of INT (primary, increment of 1).

The sample in your demo uses INT for your ID. But in my case, it returns an error.

If you still want a sample project, let me know.

Thank You
0
Ivan Todorov
Telerik team
answered on 07 Dec 2012, 12:00 PM
Hi Rhea,

The UniqueId field should not affect loading the appointments in any manner. This is a field that is used internally in some specific cases (for example, to distinguish appointments that have the same start date, end date, summary, etc.). In the general case, you do not need to store this field in your database. In our examples this field is mapped to an integer column, but there is some special code that handles storing the ID of the newly added appointments (which have an automatically generated UniqueId of type GUID). Please check the Adapter_RowUpdated handler in the source code of the example.

Yes, making the ID column of your data table accept GUIDs will prevent the exception, but I would rather suggest adding another GUID column to store the UniqueId because in some cases having an auto-increment key column is vital for database performance.

If you consider the case is not resolved or if there is still anything that is not clear, and if you think that you can invest some time in creating a sample project, I will be glad to investigate it and suggest what should be modified. So please feel free to contact us if you need further support.

Kind regards,
Ivan Todorov
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Tags
Scheduler and Reminder
Asked by
Dave Mortgatta
Top achievements
Rank 1
Answers by
Dave Mortgatta
Top achievements
Rank 1
Stefan
Telerik team
Allen
Top achievements
Rank 1
Ivan Todorov
Telerik team
Share this question
or