The VenturaConfig.DefaultConnector property stores either an AdoConnector or HttpConnector instance.


The default connector is used by the following methods, when the method's optional connector parameter is not specified:


Recordset.ExecSql()

Recordset.SaveChanges()

Transactional.ExecSql()

Transactional.SaveChanges()


The Connectors (ADO.NET and HTTP) document provides an in-depth explanation of Ventura's connectors concept.


public static Connector DefaultConnector { get; set; }


Examples

The default connector is set to an ADO.NET connector.


string connection_string = @"Server=.\SQLEXPRESS;Initial Catalog=PlayGround;Connection Timeout=30;Integrated Security=True;MultipleActiveResultSets=True";


VenturaConfig.DefaultConnector = new AdoConnector(SqlClientFactory.Instance, connection_string);


var customers = new PriKey_Customers_Recordset();

           

customers.ExecSql(100); // 100 is the customer ID


MessageBox.Show($"The number of records retrieved is {customers.RecordCount}");



The default connector is set to a HTTP connector:


VenturaConfig.DefaultConnector = new HttpConnector("DefaultConnector", "https://venturatools.com:51437/Ventura.FSPRO");