Various global library settings

Namespace: Wiker.WIDatabase
Assembly: 

Syntax

C#
public static class SETTINGS
Visual Basic
Public NotInheritable Class SETTINGS
Visual C++
public ref class SETTINGS abstract sealed

Examples

CopyC#
{
WIDatabase WIDB;
CDatabaseInfo DBInfo;

/* Create CDatabaseInfo object and populate with database login info */
DBInfo = new CDatabaseInfo();
DBInfo.DatabaseType = eDatabaseType.SQL;
DBInfo.Location     = "SqlServer";
DBInfo.DBName       = "TestDatabase";
DBInfo.Username     = "LoginName";
DBInfo.Password     = "LoginPassword";

/* Create new instance of WIDatabase */
WIDB = new WIDatabase(DBInfo);

/* Change to wait only 30 seconds for connection time out */
SETTINGS.ConnectionTimeOut = 30;

/* Wait 30 seconds for Query to time out */
SETTINGS.QueryTimeOut = 30;

/* Only Trim beginning of data */
SETTINGS.Trimming = eTrim.Start;

/* Do not make any changes to SQL Variable */
SETTINGS.PrepareSQLVariable = false;

/* Call function DatabaseFailureCallBack() upon Database failure */
SETTINGS.DatabaseFailureCallBack = DatabaseFailureCallBack;

/* Call function DebugLogCallBack() to Log debug messages */
SETTINGS.DebugLogCallBack = DebugLogCallBack;
}
/******************************************************************************/
bool DatabaseFailureCallBack(eDBErrorCodes errorCode)
{
MessageBox.Show(string.Format("DBFailureCallback {0}", errorCode.ToString()));
return(true);
}
/******************************************************************************/
void DebugLogCallBack(string message, Exception ex)
{
MessageBox.Show(string.Format("{0}\n{1}", message, ex.Message));
}

Inheritance Hierarchy

System..::..Object
  Wiker.WIDatabase..::..SETTINGS

See Also