Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Scheduler > Import / Export custom appointments to a MySQL Database

Not answered Import / Export custom appointments to a MySQL Database

Feed from this thread
  • Maarten avatar

    Posted on Jul 25, 2011 (permalink)

    Hello Telerik Team,

    Is there a possibility to import en export custom appointments from and to a MySQL Database?

    These appointments are stored with all the recurrence data.

    Can you give me some guidance or a code sample?

    This is for my thesis and I realy need this.

    Many thanks in advance!
    Maarten

    Reply

  • George George admin's avatar

    Posted on Jul 27, 2011 (permalink)

    Hello Maarten,

     
    Please, refer to our online documentation about binding RadScheduler control to the ADO.NET - http://www.telerik.com/help/wpf/radscheduler-populating-with-data-ado-net-getting-started.html. You could use MySQL database (instead of MSSQL) to store and retrieve the appointments, but will need to use EF in order to read the data from the MySQL and pass it to the RadScheduler control. Currently we don't have such an example, but you need to change only the Data Layer (database), not the logic in the Middle-tier. Please, refer the following blog post where you could find more information about how to use EF with MySQL - http://weblogs.asp.net/gunnarpeipman/archive/2010/12/09/getting-mysql-work-with-entity-framework-4-0.aspx

    Hope this helps.

    Regards,
    George
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

    Reply

  • Maarten avatar

    Posted on Jul 28, 2011 (permalink)

    When I follow every step I get the error at the 'Adding Service Reference to the Data Service' => Link

    There was an error downloading 'http://localhost:30046/SchedulerDataService.svc'.
    The request failed with the error message:
    --
    <html>
        <head>
            <title>The type 'RadSchedulerAdoNetSample.Web.SchedulerDataService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.</title>
            <style>
             body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
             p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
             b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
             H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
             H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
             pre {font-family:"Lucida Console";font-size: .9em}
             .marker {font-weight: bold; color: black;text-decoration: none;}
             .version {color: gray;}
             .error {margin-bottom: 10px;}
             .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
            </style>
        </head>
     
        <body bgcolor="white">
     
                <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
     
                <h2> <i>The type 'RadSchedulerAdoNetSample.Web.SchedulerDataService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.</i> </h2></span>
     
                <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
     
                <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
     
                <br><br>
     
                <b> Exception Details: </b>System.InvalidOperationException: The type 'RadSchedulerAdoNetSample.Web.SchedulerDataService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.<br><br>
     
                <b>Source Error:</b> <br><br>
     
                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code>
     
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>
     
                      </td>
                   </tr>
                </table>
     
                <br>
     
                <b>Stack Trace:</b> <br><br>
     
                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code><pre>
     
    [InvalidOperationException: The type 'RadSchedulerAdoNetSample.Web.SchedulerDataService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.]
       System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +52174
       System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1440
       System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44
       System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +615
     
    [ServiceActivationException: The service '/SchedulerDataService.svc' cannot be activated due to an exception during compilation.  The exception message is: The type 'RadSchedulerAdoNetSample.Web.SchedulerDataService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found..]
       System.Runtime.AsyncResult.End(IAsyncResult result) +687598
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +190
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService) +234
       System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext context) +24
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
    </pre></code>
     
                      </td>
                   </tr>
                </table>
     
                <br>
     
                <hr width=100% size=1 color=silver>
     
                <b>Version Information:</b> Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
     
                </font>
     
        </body>
    </html>
    <!--
    [InvalidOperationException]: The type 'RadSchedulerAdoNetSample.Web.SchedulerDataService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.
       at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
       at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)
       at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
       at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
    [ServiceActivationException]: The service '/SchedulerDataService.svc' cannot be activated due to an exception during compilation.  The exception message is: The type 'RadSchedulerAdoNetSample.Web.SchedulerDataService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found..
       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
       at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService)
       at System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext context)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    -->
    --.
    Metadata contains a reference that cannot be resolved: 'http://localhost:30046/SchedulerDataService.svc'.
    The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
    If the service is defined in the current solution, try building the solution and adding the service reference again.


    Is there a way to eliminate the web service? Because I don't realy need it. But when I follow the example I must use it.

    Kind regards,
    Maarten

    Reply

  • George George admin's avatar

    Posted on Aug 3, 2011 (permalink)

    Hello Maarten,

     
    You can drop the Web Service if you use WPF application. If the application and the Database server run on one and same machine or in a local network, you could use only the entity framework. In Silverlight, you are ought to transfer the data using a web service, and because we try to keep our examples for both SL and WPF platforms as same as we can, we keep the web service in the WPF documentation.

    All the best,
    George
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

    Reply

  • Maarten avatar

    Posted on Aug 3, 2011 (permalink)

    Hello George,

    Thanks for your reply.

    I left the service for what it is, but I have a next question.
    In the "Loading Data" - step you need to add a reference to an observable collection of appointment objects and to the RadSchedulerEntity (exposed by the service) to be used across the board.

    private RadSchedulerEntities dbContext = new RadSchedulerEntities( new Uri( "http://localhost:55031/SchedulerDataService.svc" ) );

    What do I need to fill in there because I didn't use a service.
    Also what changes at the LoadData() method?

    Sorry for the inconvenience.

    Kind regards,
    Maarten

    Reply

  • George George admin's avatar

    Posted on Aug 10, 2011 (permalink)

    Hello Maarten,

    The "Loading Data" - step exposes a logic how to generates Appointment and Resources objects from the database objects. Using a Data Service, you need to iterate through the dbResourceType.Resources where the dbResourceType is the ObjectContext (the Entity Data Model). If you don't use a data service, you don't need passing URI parameter to the constructor, so you could create the object with the default constructor.

    Hope this helps.


    Greetings,
    George
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Scheduler > Import / Export custom appointments to a MySQL Database
Related resources for "Import / Export custom appointments to a MySQL Database"

WPF Scheduler Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]