Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to connect full calendar v 1.5.3 with MS SQL Server using asp.net C#/VB
    primarykey
    data
    text
    <p>I have successfully connected FullCalendar v1.4.2 with sql server using asp.net webforms and vb.net. I want to update to v1.5.3, but the original integration code no longer works and I can't see how to fix it.</p> <p>Secondly, I would like help adding drag and drop features so that I update the database on drag/drop from asp.net, but I'm not sure where to start for that.</p> <p>The code I had that worked for v 1.4.2 is as follows:</p> <pre class="lang-javascript prettyprint-override"><code>&lt;script type="text/javascript" language="javascript"&gt; $(document).ready(function () { $('#calendar').fullCalendar({ header: { left: 'prev, next today', center: 'title', right: 'month, basicWeek, basicDay' }, events: "Calendar.asmx/EventList" }); }); &lt;/script&gt; </code></pre> <pre class="lang-vb prettyprint-override"><code>Imports System Imports System.Data Imports System.Web.Services Imports System.Data.SqlClient Imports System.Web.Services.Protocols Imports System.ComponentModel Imports System.Collections.Generic Imports System.Web.UI.Page &lt;System.Web.Script.Services.ScriptService()&gt; _ &lt;System.Web.Services.WebService(Namespace:="http://tempuri.org/")&gt; _ &lt;System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)&gt; _ &lt;ToolboxItem(False)&gt; _ Public Class Calendar Inherits System.Web.Services.WebService &lt;WebMethod()&gt; _ Public Function EventList(ByVal startDate As String, ByVal endDate As String) As String ' List to hold events Dim events As List(Of CalendarDTO) = New List(Of CalendarDTO)() Dim WebConfigConnection As String = ConfigurationManager.ConnectionStrings("FresheyeTimeTrackerConnectionString").ConnectionString Dim query As String = "SELECT * FROM CORE_PROJECT" Dim conn As New SqlConnection(WebConfigConnection) Dim cmd As New SqlCommand(query, conn) Dim da As New SqlDataAdapter(cmd) Dim ds As New DataSet() da.Fill(ds) 'If startDate &gt; ToUnixTimespan(DateTime.Now) Then 'GoTo x 'End If Dim starting As DateTime = FromUnixTimespan(startDate) ' Loop through events to be added For i As Integer = 0 To ds.Tables(0).Rows.Count - 1 If String.IsNullOrEmpty(ds.Tables(0).Rows(i)("ProjectDeliveryDate").ToString()) Then Else ' Create a new event and start to populate Dim value As CalendarDTO = New CalendarDTO() ' Date is required to be in a unix format value.StartDate = ToUnixTimespan(DateTime.Parse(ds.Tables(0).Rows(i)("ProjectAddedDate").ToString)) value.id = ds.Tables(0).Rows(i)("ProjectID").ToString() value.title = ds.Tables(0).Rows(i)("ProjectTitle").ToString() value.EndDate = ToUnixTimespan(DateTime.Parse(ds.Tables(0).Rows(i)("ProjectDeliveryDate").ToString)) events.Add(value) End If Next ' Serialize the return value so it can be decoded in java. x: Dim js As New System.Web.Script.Serialization.JavaScriptSerializer Return js.Serialize(events) End Function Private Function ToUnixTimespan(ByVal d As DateTime) As Int64 Dim time As New TimeSpan() time = d.ToUniversalTime().Subtract(New DateTime(1970, 1, 1, 0, 0, 0)) Return CType(Math.Truncate(time.TotalSeconds), Int64) End Function Private Function FromUnixTimespan(ByVal s As String) As DateTime Dim time As DateTime = New DateTime(1970, 1, 1, 0, 0, 0) Return time.AddSeconds(s) End Function End Class </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload