I would like to implement the scheduler but with my existing mySQL database.
I can see in the control to create sample database query.
Can i have the MySQL relevant query?
The article How to generate Scheduler tables in the MySQL database is obsolete and the database have changed since then.
It is possible also to use XPO default with C# to bind the data source? Any example ?
Now when i try to point scheduler control to datasource of XPO object with appointments table i got a object reference error.
Thanks
SQLCREATE TABLE [dbo].[Appointments] (
[UniqueID] [int] IDENTITY (1, 1) NOT NULL,
[Type] [int] NULL,
[StartDate] [datetime] NULL,
[EndDate] [datetime] NULL,
[QueryStartDate] [datetime] NULL,
[QueryEndDate] [datetime] NULL,
[AllDay] [bit] NULL,
[Subject] [nvarchar] (50) NULL,
[Location] [nvarchar] (50) NULL,
[Description] [nvarchar](max) NULL,
[Status] [int] NULL,
[Label] [int] NULL,
[ResourceID] [int] NULL,
[ResourceIDs] [nvarchar](max) NULL,
[ReminderInfo] [nvarchar](max) NULL,
[RecurrenceInfo] [nvarchar](max) NULL,
[TimeZoneId] [nvarchar](max) NULL,
[CustomField1] [nvarchar](max) NULL
CONSTRAINT [PK_Appointments] PRIMARY KEY CLUSTERED
(
[UniqueID] ASC
)
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[Resources] (
[UniqueID] [int] IDENTITY (1, 1) NOT NULL,
[ResourceID] [int] NOT NULL,
[ResourceName] [nvarchar] (50) NULL,
[Color] [int] NULL,
[Image] [image] NULL,
[CustomField1] [nvarchar](max) NULL
CONSTRAINT [PK_Resources] PRIMARY KEY CLUSTERED
(
[UniqueID] ASC
)
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Resources] ON
INSERT [dbo].[Resources] ([UniqueID], [ResourceID], [ResourceName], [Color], [Image], [CustomField1]) VALUES (1, 1, N'Resource One', NULL, NULL, NULL)
INSERT [dbo].[Resources] ([UniqueID], [ResourceID], [ResourceName], [Color], [Image], [CustomField1]) VALUES (2, 2, N'Resource Two', NULL, NULL, NULL)
INSERT [dbo].[Resources] ([UniqueID], [ResourceID], [ResourceName], [Color], [Image], [CustomField1]) VALUES (3, 3, N'Resource Three', NULL, NULL, NULL)
SET IDENTITY_INSERT [dbo].[Resources] OFF
Hello John,
We don't have a ready MySQL script to generate a database for Scheduler Control. You can adapt the query Andrey provided in the How to generate Scheduler tables in the MySQL database thread, or use an SQL Query converter: https://www.rebasedata.com/convert-mssql-to-mysql-online.
As for binding Scheduler to XPO, please refer to the following help article: How to: Bind the Scheduler with Multi-resource Appointments to XPO. You can download an example as well: How to bind the XtraScheduler with multi-resource appointments to XPO.
Hello Sasha,
None of the 2 options you provided are not working for mySQL. As the example article is years ago and the database schema for the scheduler control is no longer the same.
As for the converted website is just don't work . Cant seem to find any website that convert successfully the MSSQL schema to MySQL, so i would really appreciate if anyone can just make those 2 tables in MySQL format.
Also i have tested the scheduler in a test mysql table i have manually create and i seem to have an issue when create a recurring event or appointment.
In scheduler stock new recurring appointment window, there is a setting called Range of Recurrence. And the default is No end data selected. However when i press save o got a DATE OVERFLOW ERROR. Can you please suggest how i can avoid that ? I am using MySQL 5.7.31 for Windows. error.JPG
Hello,
We don't have a step-by-step guide that illustrates how to bind SchedulerControl to a MySQL database. You can use the common concept of binding SchedulerControl to a database. The main idea is to create all required fields in your database and bind them to corresponding SchedulerControl properties. You can find all required fields for appointments in the following thread: Appointment Mappings. Also, I suggest that you review the following ticket where Brad Thomas described the most frequent issues: SchedulerControl and MySQL - best practice.
As for the exception, it can be related to a "zero date" issue described in this StackOverflow thread: Unable to convert MySQL date/time value to System.DateTime. Try this solution in your project and let me know your results. If it does not help, please share a project to demonstrate the following:
-your data structure;
-How do you bind this database to SchedulerControl;
-How do you save your data;
-When you execute your code.
I look forward to your response.