Allen

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!

Ivan Todorov

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.

Allen

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

Ivan Todorov

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.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.