Posted 6 February 2020, 1:08 am EST
Ok, there is definitely some sort of bug here. I took your example and created a VB app using the exact same code that I am using and your Access database. Ran it and it worked. Converted the same database to SQL server and it once again ignored the AllDayEvent property. I even changed my app so that if I dragged an appointment into the “all day” area of the Day view it would save the Properties value back into the database. When I reloaded the form, it once again ignored the AllDayEvent property and displayed the appointment as being 12:00 AM. I believe that the problem is somehow related to using SQL Server as the datasource.
To reproduce the problem, do this:
-
Create a SQL Database with a schedule table containing the columns in your Access sample. Add the same sample records as you have in the Access Database.
-
Create a VB.NET Windows Forms App.
-
Add a form and add a Schedule Control to it.
-
Create a Dataset.
-
Add a Table Adapter
-
Add this code to the form’s on load event:
Dim ScheduleTable As New DataTable
Dim ScheduleAdapter As New DataSet1TableAdapters.AppointmentTableAdapter
ScheduleTable = ScheduleAdapter.GetData
C1Schedule1.DataStorage.AppointmentStorage.Mappings.AppointmentProperties.MappingName = "Properties"
C1Schedule1.DataStorage.AppointmentStorage.Mappings.Subject.MappingName = "Subject"
C1Schedule1.DataStorage.AppointmentStorage.Mappings.Start.MappingName = "Start"
C1Schedule1.DataStorage.AppointmentStorage.Mappings.End.MappingName = "End"
C1Schedule1.DataStorage.AppointmentStorage.Mappings.Body.MappingName = "Body"
C1Schedule1.DataStorage.AppointmentStorage.Mappings.Location.MappingName = "Location"
C1Schedule1.DataStorage.AppointmentStorage.DataSource = ScheduleTable
Run the app. The appointments will show up as 12:00AM instead of “all day”. As soon as you switch to SQL Server and load the appointments from that database, they no longer come in as “AllDayEvents”
Follow the same procedure with an Access database and run it and it works fine.