Open the AspNetServer solution
Select the project folder in the file explorer and double-click "AspNetServer.sln" to open the Visual Studio solution.
The project folder is easy to reach by clicking the [Explorer] button in VenturaSQL Studio.
Restore NuGet packages
Visual Studio C# projects included with the VenturaSQL templates have their NuGet packages folder deleted. This was done to keep the VenturaSQL installer small.
The Visual Studio solution needs to restore the NuGet packages folder. See topic Restore NuGet packages for more information.
In Visual Studio go to Build -> Rebuild Solution and wait for the packages to be restored.
Right-click "References" in the Solution Explorer and select "Manage NuGet Packages".
Select the "Installed" tab.
The package "System.Data.SqlClient" is the ADO.NET Provider for SQL Server (including Azure SQL).
The package "VenturaSQL.AspNet" is the ASP.NET server bits for the VenturaSQL run-time.
The package "VenturaSQL.NETStandard" is the run-time for VenturaSQL.
The generated recordsets are used by the server for processing client requests.
About the recordsets in a server project: the recordsets can at the same time be used locally, for example for filling web-pages with data.
In the Web.config file, the VenturaSQL HTTP-listener was set-up.
Path "Ventura.FSPRO" is linked to the VenturaServer.FrameStreamProcessor class in the <handlers> node.
Application_Start is called when the web application is loaded or re-loaded.
1) The VenturaConfig.RequestHandler is set to the "() => new CustomRequestHandler()" lambda expression.
When the ASP.NET HTTP server receives a request, the lambda is executed at it returns a new CustomRequestHandler object. The next section will explain the custom request handler.
2) The database connection string.
For simplicity of the template, the connection string is set in code. However, ASP.NET connection strings are usually stored in the Web.config file. Setting and retrieving a connection string from Web.config is explained in topic Set up an ASP.NET project.
3) The VenturaConfig.DefaultConnector is set to SQL Server.
The CustomRequestHandler class implements interface IVenturaRequestHandler.
1) A client transmits the username and password that are set in the HttpConnector to the server. The data is then passed to the Authenticate method when the request is received by the server.
Simply throwing an Exception() will cancel the request, and the error message will be transmitted back to the client.
2) The LookupAdoConnector method is called with the HttpConnector's name as a parameter.
The method needs to return an AdoConnector to use for handling the request. In the template the DefaultConnector that was already set in Global.asax.cs was returned.
In more complex scenarios the AdoConnector can be set depending on user-name and/or remote connector name.
Open the project settings page by selecting menu option Project -> AspNetServer Properties.
1) Notice that the "Start Action" is set to "Specific Page". When running the server, the Internet-browser will be started and the browser will open the selected page.
2) The page to open is Ventura.FSPRO
3) Notice the port 52467. This is the port number that will be used by the IIS Express development server.
Run the server
Run the server by clicking the [Run] button.
The Internet-browser will open with the url http://localhost:52467/Ventura.FSPRO and display an informational page to confirm that the server is running. The page is served by the VenturaServer.FrameStreamProcessor class.
The ASP.NET server is waiting for requests. You can run the WpfClient.sln solution in the previous topic and send a request.