C1schedule not all appointments loaded

Posted by: fsegui on 28 September 2021, 10:46 pm EST

  • Posted 28 September 2021, 10:46 pm EST

    Hi,
    I'm encountering an issue with C1schedule linked to database (with usage of tableadapter).
    I'm loading all appointments from a database like this :
    CalendarControl.BeginUpdate()
    CalendareventsTableAdapter1.Adapter.SelectCommand.CommandText = "sql request with filters"
    CalendareventsTableAdapter1.ClearBeforeFill = True
    CalendareventsTableAdapter1.Fill(Me.Calendar.calendarevents)
    CalendarControl.EndUpdate()


    In database, I have 4738 lines (so 4738 appointments) but when I spy on the appointments storage, I get only 2344 appointments.

    How is that possible?
    I think that some appointments could not be loaded but I get no error.

    In consequence, I cannot add any appointment. I got the same error that I had some months ago (see forum post https://www.grapecity.com/forums/winforms-edition/appointmentadded-event-key
  • Replied 29 September 2021, 8:00 pm EST

    Hi,

    We could not replicate the issue at our end.
    Could you please share a sample with a dummy database replicating the issue? It will really help us in investigating the issue at our end and help you accordingly.

    Regards
    Avnish
  • Replied 29 September 2021, 10:43 pm EST

    Hi Avnish,

    Unfortunately I cannot provide you with a sample as it's linked to a customer database.
    I'm trying to isolate on which property the issue is.
    If I reset the appointmentprops field (in my database) with dummy data, I then get all appointments. So there must be an issue with some customdata.
    Is there a way to catch a customdata issue? (not correctly formatted?)

    Thanks
  • Replied 30 September 2021, 5:27 pm EST

    Hi,

    It might be the cause of the issue as an invalid appointment will not be loaded. Sorry for the inconvenience but currently there is no event or method to catch the invalid appointment. We have escalated the issue to the development team to get their insights and will let you know when we have an update.
    If possible, can you please provide us with a sample appointment data that has the issue?

    [C1WIN-25785]

    Regards
    Avnish
  • Replied 3 October 2021, 10:47 pm EST

    Hi,

    As per the dev team, it would be great if you can make stripped-down sample with maybe 1 or 2 appointment rows using MS Access which reproduces the problem, and attach it here.
    Or maybe you can run your application in debug mode, set VS to break on all handled CLR exceptions, and see whether there are exceptions that are not shown in release mode. If there are, send us stack trace and all exception information.

    Regards
    Avnish
  • Replied 4 October 2021, 5:06 pm EST

    Hi Avnish,

    Ok, I'll try to do that. I'll keep you informed.

    BR,
    Florent
  • Replied 27 January 2022, 2:47 am EST

    Hi Avnish,

    I've isolated an event that caused the issue. It seems it's linked to the & character.

    I'm not able to get the data into MSAccess. If I export the data and reimport it into MS Access, the appointment loads fine. (we're using PostGreSQL)
  • Replied 27 January 2022, 5:13 pm EST

    Hi,

    If the issue was caused by a C1Schedule event Could you please share the following details about your observations?
    - The event of C1Schedule causing the issue.
    - How is the issue linked to the "&" character.
    - Steps you followed to replicate the issue
    - A sample appointment record, so that we can test it at our end.

    Regards
    Avnish
  • Replied 15 February 2022, 8:22 pm EST

    Hi,
    You'll find attached a sample reproducing the issue (only one appointment).
    The "&" is in the customdata field.

    C1ScheduleDemo.zip
  • Marked as Answer

    Replied 16 February 2022, 2:54 pm EST

    Hi,

    Thank You for providing the sample. The issue you are facing is due to the invalid character '&' not being escaped in the custom properties XML.

    When you read the XML in a dataset, the escaped ampersand(&) gets read as '&' and is stored as '&' in the "custompropertiesxmldata" field. Now when C1Schedule tries to parse the XML data from the custompropertiesxmldata field, it encounters the invalid character '&' and not the escaped ampersand (&).
    You need to modify the XML data so that the ampersand in the fields that contains XML data are escaped after being read in a DataSet. Please refer to the sample attached showing the same.

    Regards
    Avnish

    C1ScheduleDemo_mod.zip
  • Replied 16 February 2022, 7:25 pm EST

    Hi,

    Thanks for your quick feedback. Works fine with your inputs.
    I'll also handle other characters like this.

    Best regards
    Florent
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels