Restore NuGet packages

Visual Studio C# projects included with the Ventura SQL templates have their NuGet packages folder deleted. This was done to keep the Ventura SQL 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.


Assembly references



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).


In a Client project that only connects to SQL Server through the middle-tier, a reference to System.Data.SqlClient would not be needed.


The package "VenturaSQL.NETStandard" is the run-time for Ventura SQL.

MainWindow.xaml.cs



The MainWindow is the starting point for the application.


Depending on the radio-button selected in the main window dialog, the VenturaConfig.DefaultConnector property is set to an AdoConnector or HttpConnector.


The AdoConnector connects to the Azure SQL demo database.


The HttpConnector connects with the the middle-tier. We will walk through the middle-tier project in the next topic.


The Recordset.ExecSql() and Recordset.SaveChanges() methods will use the VenturaConfig.DefaultConnector if no connector is specified as a parameter.

CustomerListWindow.xaml.cs

The code-behind for the CustomerList window.



1) The CustomersListRecordset _rs is declared.

2) The recordset is initialized.

3) The recordset is data bound to the DataGrid.



In the Click-event for the Load button the SQL script is executed and the recordset and DataGrid are filled with data.




Proceed to topic AspNetServer.sln.