title: populating fullcalendar using SQL Server
body: <p>I have seen several questions around this topic on here, but can't seem to get my fullcalendar to display properly using the provided methods, so I was hoping someone could give me a hand with fixing my issue.</p>
  
  <p>My JSON feed seems to populate correctly, although I see some saying that it only works with single quote, and others only work with double quotes.  (possibly an issue with the double quotes surrounding the whole feed?)</p>
  
  <pre><code>"[{"title":"change1","start":"2016-10-17T10:00:00","end":"2016-10-17T12:00:00","allDay":false},{"title":"change2","start":"2016-10-18T10:00:00","end":"2016-10-18T12:00:00","allDay":true},{"title":"change3","start":"2016-10-19T10:00:00","end":"2016-10-19T12:00:00","allDay":false}]"
  </code></pre>
  
  <p>calendar.aspx.cs:</p>
  
  <pre><code>public class Event
          {
              public string title;
              public string start;
              public string end;
              public bool allDay;
          }
          [WebMethod]
          public static string GetEvents()
          {
              var events = new List&lt;Event&gt;();
              var sqlQuery = "SELECT title, starttime, endtime, allDay FROM [DeploymentDashboard].[dbo].[ChangeCalendar]";
  
              using (var sqlConnection = new SqlConnection("Data Source=*server*;Initial Catalog=DeploymentDashboard;Integrated Security=True;"))
              {
                  using (var cmd = new SqlCommand(sqlQuery, sqlConnection))
                  {
                      sqlConnection.Open();
                      using (var reader = cmd.ExecuteReader())
                      {
                          if (reader.HasRows)
                          {
                              while (reader.Read())
                              {
                                  events.Add(new Event()
                                  {
                                      start = DateTime.Parse(reader["starttime"].ToString()).ToString("s"),
                                      end = DateTime.Parse(reader["endtime"].ToString()).ToString("s"),
                                      title = reader["title"].ToString(),
                                      allDay = (bool)reader["allDay"]
                                  });
                              }
                          }
                      }
                      sqlConnection.Close();
                  }
              }
  
          var theSerializer = new JavaScriptSerializer();
          return theSerializer.Serialize(events);
      }
  </code></pre>
  
  <p>calendar.aspx:</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function () {
          $.ajax({
              type: "POST",
              url: "calendar.aspx/GetEvents", 
              data: "{}",
              contentType: "application/json; charset=utf-8",
              dataType: "json"
          }).done(function (data) {
              $('#calendar2').fullCalendar({
                  header: {
                      left: 'prev,next today',
                      center: 'title',
                      right: 'month,agendaWeek,agendaDay'
                  },
                  events: data.d
              });
          });
      });
  &lt;/script&gt;
  </code></pre>