This is a migrated thread and some comments may be shown as answers.

Scheduler Connects to database when I run it locally but not after I load it to the server. Internal Server Error 500

1 Answer 93 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 23 Jan 2020, 01:17 PM

Running the scheduler app locally and it connects fine to my database and it works great.  When I upload it to our IIS server the page loads but there is no data.  When I try to create a new event and hit save the event window just sits there.  When I look at the console I see 'Tasks_Read 500 (Internal Server Error)' and that is really just it.

Here is my model:

using System.Collections.Generic;
using System.Linq;
using System.Web;
using Kendo.Mvc.UI;
 
namespace Calendar.Models
{
    public class TaskViewModel : ISchedulerEvent
    {
        public int TaskID { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
 
        private DateTime start;
        public DateTime Start { get; set; }
 
        private DateTime end;
        public DateTime End { get; set; }
 
        public string RecurrenceRule { get; set; }
        public int? RecurrenceID { get; set; }
        public string RecurrenceException { get; set; }
        public bool IsAllDay { get; set; }
        public int? OwnerID { get; set; }
        public string EndTimezone { get; set; }
        public string StartTimezone { get; set; }
         
    }
}

 

Here is the Read Section on my controller:

public ActionResult Tasks_Read([DataSourceRequest]DataSourceRequest request)
{
    using (var sampleDB = new SampleEntities())
    {
 
        IQueryable<TaskViewModel> tasks = sampleDB.Tasks.ToList().Select(task => new TaskViewModel()
        {
            TaskID = task.TaskID,
            Title = task.Title,
            // Specify the DateTimeKind to be UTC.
            Start = DateTime.SpecifyKind(task.Start, DateTimeKind.Utc),
            End = DateTime.SpecifyKind(task.End, DateTimeKind.Utc),
            Description = task.Description,
            IsAllDay = task.IsAllDay,
            RecurrenceRule = task.RecurrenceRule,
            RecurrenceException = task.RecurrenceException,
            RecurrenceID = task.RecurrenceID,
            OwnerID = task.OwnerID,
            StartTimezone = task.StartTimezone,
            EndTimezone = task.EndTimezone
        }).AsQueryable();
 
        return Json(tasks.ToDataSourceResult(request));
    }
}

 

And here is the code in my view:

@using Calendar.Models
@{
    var name = ViewBag.Name;
    //ViewBag.Title = "Home Page";
    }
 
@name
 
 
@(Html.Kendo().Scheduler<TaskViewModel>()
                                .Name("scheduler")
                                .Date(DateTime.Today)
                                .StartTime(new DateTime(2019, 12, 01, 7, 00, 00))
 
                                .Height(600)
                                .Views(views =>
                                {
                                    views.DayView();
                                    views.WeekView();
                                    views.MonthView(monthView => monthView.Selected(true));
                                    views.AgendaView();
                                })
 
 
                                .DataSource(d => d
                                 
                                .Model(m =>
                                {
                                    m.Id(f => f.TaskID);
                                    m.Field(f => f.OwnerID).DefaultValue(1);
                        // Set the recurrence ID field from the model.
                        m.RecurrenceId(f => f.RecurrenceID);
 
 
                                })
                                .Read("Tasks_Read", "Home")
                                .Create("Tasks_Create", "Home")
                                .Destroy("Tasks_Destroy", "Home")
                                .Update("Tasks_Update", "Home")
                            )
)


1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 27 Jan 2020, 07:55 AM

Hello Daniel,

The error observed (Internal server), the events not being read properly and the fact that the application runs properly locally point to an issue with access to the database on the IIS server. Please, review all rights assigned to the database and make sure the IIS user has read/write access to it. Also, review the Internal server error stack trace for further pointers on where exactly the issue is hidden.

Regards,
Veselin Tsvetanov
Progress Telerik

Get quickly onboarded and successful with your Telerik UI for ASP.NET MVC with the dedicated Virtual Classroom technical training, available to all active customers.
Tags
Scheduler
Asked by
Daniel
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or