Setting the DefaultConnector
The recordsets that VenturaSQL Studio adds to a server project are used by the server runtime to process incoming requests. This is explained in topic Client and server recordsets.
The recordsets can also be used access a database directly, just like in a client application. For example when you are also using the server project as web-page server and you want to fill a HTML page with data.
You need set the VenturaConfig.DefaultConnector to an AdoConnector when the web application starts.
The DefaultConnector is used for Recordset.ExecSql, Recordset.SaveChanges, Transactional.ExecSql and Transactional.SaveChanges calls.
Also see Recordsets in your code > Connectors (ADO.NET and HTTP)
Setting the DefaultConnector at web application startup
ASP.NET
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
VenturaConfig.DefaultConnector = new AdoConnector(SqlClientFactory.Instance, connection_string);
}
}
ASP.NET Core
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
VenturaConfig.DefaultConnector = new AdoConnector(SqlClientFactory.Instance, connection_string);
}
}