dhtmlxConnector & SQLServer

Heya there,

I’m using Visual Studio 2015 and I’d like to know if there’s a way to manage data of an already existing SQL Server Database using the dhtmlxConnector.
If so, is it better to code on the HTML page or should the Controller file be used instead?

Thanks in advance,
Granvic

Hello,
sorry for the delay.
Do you mean you want to build a web forms application? If so, please check this tutorial
blog.scheduler-net.com/post/effi … n-use.aspx (if you’ll be downloading the demo - make sure to restore and update nuget packages before runing it)

If you want to use dhtmlxConnector in MVC application - it’s also possible and the code will look almost the same.
The only difference is that how connectors are used. Instead of asp.net handler, you’ll need to place it in a void action of connector:

[code]public class HomeController : Controller
{
public void Data()
{
// get current http context
var baseContext = this.HttpContext;
var context = baseContext.ApplicationInstance.Context;

    var connector = new dhtmlxSchedulerConnector(
        "Events"
        "EventId",
        dhtmlxDatabaseAdapterType.SqlServer2005,
        ConfigurationManager.ConnectionStrings["MyCalendar"].ConnectionString,
        "StartDate", "EndDate",
        "Name as text,Details,DepartmentId"
    );

    // provide connector with http request data
    connector.ProcessRequest(context.Request.QueryString, context.Request.Form);
    connector.RenderResponse(context.Response);
}

}[/code]

However, I’m not sure if usage of dhtmlxConnector gives a big advantage over usage of LinqToSQL or EntityFramework. Unless you already use connectors for different parts of your app, I’d suggest you use EntityFramework instead of them

Thanks for your answer, fortunately, I was able to solve that issue using EF Code First. :slight_smile:

Best Regards,
Granvic