dhtmlxScheduler ASP.Net (SQL & .NET Connector)

Can someone please help with initializing the .NET Connector?

docs.dhtmlx.com/connector__net__init.html

scheduler.init(‘scheduler_here’, new Date(), “month”);
myScheduler = new dhtmlXScheduler(“scheduler_here”);
myScheduler.load(“schedulerConnector.ashx”);

myDP = new dataProcessor(“schedulerConnector.ashx”);
myDP.init(scheduler);

schedulerConnector.ashx

<%@ WebHandler Language=“C#” Class=“schedulerConnector” %>
using System;
using System.Web;
public class schedulerConnector : IHttpHandler {

public void ProcessRequest (HttpContext context) {
    context.Response.ContentType = "text/plain";
    //context.Response.Write("Hello World");
   
}
 public bool IsReusable {
    get {
        return false;
    }
}
public override IHttpHandler CreateConnector(HttpContext context)
{
    var connector = new schedulerConnector(
        "Events", "EventId",
        dhtmlxDatabaseAdapterType.SqlServer2005,
        ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString, "start_date", "end_date");
    return connector;
}

}

Thank you in advance!

Hi,
note the base class of ashx handler. In tutorial you referencing to the handler is inherited from dhtmlxRequestHandler class, in your code sample - it only implements IHttpHandler interface
Try following:

[code]<%@ WebHandler Language=“C#” Class=“schedulerConnector” %>
using System;
using System.Web;

public class schedulerConnector : dhtmlxRequestHandler {

public override IHttpHandler CreateConnector(HttpContext context)
{
	var connector = new schedulerConnector(
		"Events", "EventId",
		dhtmlxDatabaseAdapterType.SqlServer2005,
		ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString, "start_date", "end_date");
	return connector;
}

}[/code]

Aliaksandr,

Thank you for your reply.

I am trying with Visual Studio 2010 to connect to a SQL Server 2012 database so I can load the dhtmlxScheduler from the database as well as save the changes from the dhtmlxScheduler back to the database.

Once I get this proof of concept working and can demo it to our company I’m sure I will receive the approval for the budget in purchasing the Professional version. I wish to use dhtmlxScheduler_4.3.1 (docs.dhtmlx.com/connector__net__index.html).

I’m sorry but I am not a C# guy. Is there a VB example somewhere?

I appreciate any help you can provide!

I’ll look for an example, but can you clarify what the difficulty you having?
The code should basically declare a class inherited from dhtmlxRequestHandler (defined in connectors assembly). The declared class must have a override a method named CreateConnector which takes HttpContext as parameter and returns instance of dhtmlxSchedulerConnector as IHttpHandler, it should be very similar in all .net languages.

I believe the VB code should will look quite close to the following:

[code]<%@ WebHandler Language=“VB” Class=“schedulerConnector” %>
Imports System.Web

Public Class schedulerConnector
Inherits dhtmlxRequestHandler

Public Overrides Function CreateConnector(context As HttpContext) As IHttpHandler
	Dim connector = New dhtmlxSchedulerConnector("Events", "EventId", dhtmlxDatabaseAdapterType.SqlServer2005, ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString, "start_date", "end_date")
	Return connector
End Function

End Class[/code] Please clarify if you have some specific errors with it

Aliaksandr,

Thank you for helping me out. Attached are the three error images.






Hi,
try adding reference to dhtmlxConnectors namespace to that file:

Imports dhtmlxConnectors

Aliaksandr,

Thank you for your reply. I apologize for the confusion and wasting your time but I am obviously missing something basic here. The demo project I created has the following:

dhtmlxscheduler.js
dhtmlxscheduler.css

There are no other DLL references. As well I do not have a PHP server.

I simply want to load the dhtmlxScheduler (not Scheduler.NET) with data from a Microsoft SQL database and then write the changes back.

Thank you so much in advance for your help.




Hi,
seems i’ve made a mistake in my my first reply,

public override IHttpHandler CreateConnector(HttpContext context) The type of return value should be IdhtmlxConnector, not IHttpHandler. Also be sure to add a reference to dhtmlxConnector.NET.dll
Please check the working example:
s3.amazonaws.com/uploads.hipcha … tor.VB.zip

Aliaksandr,

It worked! Thank you so much. I really appreciate all of your assistance.

Your the best!!!

Aliaksandr,

Sorry, this might be a silly question but how do I reference a differently named table other than the one name “events”:

Dim connector = New dhtmlxSchedulerConnector(
“events” _

Aliaksandr,

Is it possible to use another table name instead of “events”?

Dim connector = New dhtmlxSchedulerConnector(
“events” _

Hello,
table name as well as names of columns are set as variable parameters, so you can specify any