Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
138
WinSchedule With MySQL - Why So Hard?
posted

Ok, I must be missing something.  Why is getting WinSchedule to work with a MySQL backend so difficult?

Setup: Development Platform - Visual Studio 2008.  MySQL Connector - 6.0.5.  WinSchedule version - 8.1

I have a MySQL table set up for Appointments.  I've added on appointment to it manually.  All I want is to display that one appointment on a MonthViewSingle calendar.  On the form I have UltraCalendarInfo1, UltraMonthViewMulti1 and UltraMonthViewSingle1.  Everything is set up.  Everything is ready to go.  Problem - I can't connect to the database via Bind.  So, I create an Appointment class and try to bind the CalendarInfo to it.  When I run it I get "Object reference not set to an instance of an object".  Absolutely nothing I've tried has worked, and there's no documentation whatsoever for the WinSchedule control.  I've been trying to figure this out with a Trial-And-Error approach (apparently my only option) for 3 solid work days and I'm about over it.  I'm giving this 8 more hours and I'm scrapping Infragistics and finding something else.

Does ANYONE have ANY idea who to make this work?  I'm not trying to split an atom or anything.  I just want a @#$% appointment to show up on the calendar!

Parents
  • 2094
    Offline posted

    You are right... it is not rock science to get this working. But I dispute the fact that there is no documentation. Document is very good and quiet extensive.

    Also use the samples provided. The WinSchedule Database Sample is VERY VERY GOOD.

    • Put a UltraCalendarInfo, UltraMonthViewMulti, UltraMonthViewSingle on your form
    • Set the UltraCalendarInfo Property of both your MonthViewMulti and MonthViewSingle to point at your instance of your UltraCalendarInfo
    • Assumingly you are able to get an ADO.NET Dataset/Datatable in memory - this is basic Data Access which has nothing to do with Infragistics controls. If you are struggling to do this then you are in more trouble then your seemingly lack of ability to read documentation and/or review samples.
    • Now that you have your Dataset in memory you need to setup the binding between your dataset and the UltraCalendarInfo object. It will be the UltraCalendarInfo object that you will be binding your datasource to.
    • In your datasource you should have all required mandatory fields which are the correct data types, eg: StartDateTime should be a Date/Time data type etc.
    • On the UltraCalendarInfo object specify which columns in your datasource map to each bindable property etc.

     

    Here is an example from the DOCUMENTATION. In this example the datasource (a DataTable) is created MANUALLY. Take note of the data Types of each MANDATORY Appointment DataBinding Object.

     

    Of course this example won't help you if you can't even read from the database but I am going to assume this is not where your problem lies. I suspect you can atleast get this far. Most likely your data types don't match those of the properties you are trying to bind to, OR you are not binding the UltraCalendarInfo object.

     

    GOod Luck.

     

    #Region " CreateAppointmentsDataTable "
        'Create the structure of the Appointments Table
        Private Function CreateAppointmentsDataTable() As DataTable
            Dim newTable As DataTable = New DataTable()

            'Basic Appointment properties
            ' In order to function properly, the table must contain data for
            ' Subject, StartDateTime, and EndDateTime. These three fields are
            ' required for an appointment. So all of these will have DefaultValues.
            newTable.Columns.Add("Subject", GetType(String))
            newTable.Columns("Subject").DefaultValue = "New Appointment"
            newTable.Columns.Add("StartDateTime", GetType(DateTime))
            newTable.Columns("StartDateTime").DefaultValue = DateTime.Now
            newTable.Columns.Add("EndDateTime", GetType(DateTime))
            newTable.Columns("EndDateTime").DefaultValue = DateTime.Now.AddHours(1)
            newTable.Columns.Add("Description", GetType(String))

            ' All other fields are Optional.

            'Properties for AllDayEvents
            newTable.Columns.Add("AllDayEvent", GetType(Boolean))
            newTable.Columns("AllDayEvent").DefaultValue = False

            'Properties for Reminders
            newTable.Columns.Add("ReminderEnabled", GetType(Boolean))
            newTable.Columns("ReminderEnabled").DefaultValue = False
            newTable.Columns.Add("ReminderInterval", GetType(Integer))
            newTable.Columns.Add("ReminderUnits", GetType(Integer))

            'Properties when imports owners
            newTable.Columns.Add("OwnerKey", GetType(String))

            'Properties when imports recurring appointments.
            newTable.Columns.Add("RecurrenceId", GetType(System.Guid))
            newTable.Columns.Add("Recurrence", GetType(Byte()))
            newTable.Columns.Add("OriginalStartDateTime", GetType(DateTime))

            'DataKey is an extra field that can be used to link the appointment to some external data.
            newTable.Columns.Add("DataKey", GetType(String))

            'All properties
            ' Any other Appointment properties not covered above are stored as
            ' Binary data in the AllProperties field. This includes properties like
            ' BarColor, Location, etc.
            newTable.Columns.Add("AllProperties", GetType(Byte()))

            Return newTable
        End Function
    #End Region

    #Region " SetAppointmentBindings"
        'Set the Data Bindings for Appointments
        Private Sub SetAppointmentBindings()
                ' Get the data
                Me.scheduleData.Tables.Add( Me.CreateAppointmentsDataTable() )

            ' Set the BindingContextControl so the component will use the same context
            ' that the grid and any other controls on the form are using.
            Me.ultraCalendarInfo1.DataBindingsForAppointments.BindingContextControl = Me

            ' Basic Appointment properties
            Me.ultraCalendarInfo1.DataBindingsForAppointments.SubjectMember = "Subject"
            Me.ultraCalendarInfo1.DataBindingsForAppointments.DescriptionMember = "Description"

            Me.ultraCalendarInfo1.DataBindingsForAppointments.StartDateTimeMember = "StartDateTime"
            Me.ultraCalendarInfo1.DataBindingsForAppointments.EndDateTimeMember = "EndDateTime"
            Me.ultraCalendarInfo1.DataBindingsForAppointments.AllDayEventMember = "AllDayEvent"

            Me.ultraCalendarInfo1.DataBindingsForAppointments.ReminderEnabledMember = "ReminderEnabled"
            Me.ultraCalendarInfo1.DataBindingsForAppointments.ReminderIntervalMember = "ReminderInterval"
            Me.ultraCalendarInfo1.DataBindingsForAppointments.ReminderUnitsMember = "ReminderUnits"

            'Properties when imports owners
            Me.ultraCalendarInfo1.DataBindingsForAppointments.OwnerKeyMember = "OwnerKey"

            'Properties when imports recurring appointments.
            Me.ultraCalendarInfo1.DataBindingsForAppointments.RecurrenceIdMember = "RecurrenceId"
            Me.ultraCalendarInfo1.DataBindingsForAppointments.RecurrenceMember = "Recurrence"
            Me.ultraCalendarInfo1.DataBindingsForAppointments.OriginalStartDateTimeMember = "OriginalStartDateTime"

            ' All other properties
            Me.ultraCalendarInfo1.DataBindingsForAppointments.AllPropertiesMember = "AllProperties"

            'DataKey is an extra field that can be used to link the appointment to some external data.
            Me.ultraCalendarInfo1.DataBindingsForAppointments.DataKeyMember = "DataKey"

            ' DataSource & DataMember
            Me.ultraCalendarInfo1.DataBindingsForAppointments.SetDataBinding(Me.scheduleData, string.Empty)
        End Sub

    #End Region

     

Reply Children
No Data