Every SelfServicing generated set classes has one class which controls a couple of global settings for the application: CommonDaoBase.cs/vb, located in the DaoClasses namespace. Below are the options it offers as static (shared) options.
The CommonDaoBase class lets you set the global connection string to use for every connection to the database. This setting overrides the connection string read from the appSettings section in the .config file. Once the setting is set, every connection to the database uses the set connection string. You set the connection string to use at runtime using the following code:
CommonDaoBase.ActualConnectionString = "Datasource=myserver;....";
If you want to make the application use the connection string defined in the config file again, simply set the ActualConnectionString property to string.Empty.
If you want to set the ADO.NET command timeout to a value other than the default of 30 seconds, use the CommonDaoBase.CommandTimeOut property to set it to a different value. This will change the timeout immediately for all calls to the database.
Firebird and SQL Server CE don't support command timeouts.
If an entity is saved into a table which is part of an indexed view,
SqlServer requires that
SET ARITHABORT ON is specified prior to the
actual save action. You can tell LLBLGen Pro to set that option, by
calling the global method CommonDaoBase.SetArithAbortFlag(bool) method.
After each SQL statement a
SET ARITHABORT OFF statement will be executed
if the ArithAbort flag is set to true. Setting this flag affects all
INSERT statements following the call to SetArithAbortFlag(), until you
call that method again.
To set the compatibility mode of the SqlServer DQE in code, you can use the CommonDaoBase method SetSqlServerCompatibilityLevel (SQL Server) or SetFirebirdCompatibilityMode, as shown in the following example which sets the compatibility mode to SqlServer 2012:
To set the compatibility level for Oracle at runtime, you can use the CommonDaoBase static method SetOracleCompatibilityLevel as shown in the following example, which sets the compatibility level to Oracle 12c: