Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Scheduler and Reminder > Error when added new appointment

Answered Error when added new appointment

Feed from this thread
  • Dave Mortgatta avatar

    Posted on Apr 17, 2012 (permalink)

    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.

    Reply

  • Answer Dave Mortgatta avatar

    Posted on Apr 17, 2012 (permalink)

    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


    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Stefan Stefan admin's avatar

    Posted on Apr 20, 2012 (permalink)

    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 >>

    Reply

  • RHEA avatar

    Posted on Dec 3, 2012 (permalink)

    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!

    Reply

  • Ivan Todorov Ivan Todorov admin's avatar

    Posted on Dec 5, 2012 (permalink)

    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.

    Reply

  • RHEA avatar

    Posted on Dec 5, 2012 (permalink)

    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

    Reply

  • Ivan Todorov Ivan Todorov admin's avatar

    Posted on Dec 7, 2012 (permalink)

    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.

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Scheduler and Reminder > Error when added new appointment
Related resources for "Error when added new appointment"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]