internal VistaDBConnection(VistaDBDatabase db): this() { if(db.Parameters != VDBDatabaseParam.InMemory) throw new VistaDBException(VistaDBErrorCodes.DatabaseMustBeTemporary); this.vistaDBSQL = new VistaDBLocalConnection(db); this.exclusive = true; this.connectionState = ConnectionState.Open; }
internal VistaDBConnection(VistaDBDatabase db) : this() { if (db.Parameters != VDBDatabaseParam.InMemory) { throw new VistaDBException(VistaDBErrorCodes.DatabaseMustBeTemporary); } this.vistaDBSQL = new VistaDBLocalConnection(db); this.exclusive = true; this.connectionState = ConnectionState.Open; }
public VistaDBSQLQuery(VistaDBSQLConnection p) { rowsAffected = 0; recordCount = 0; commandText = ""; columnCount = 0; password = ""; errorNumber = 0; parent = p; opened = false; Columns = new VistaDBColumnCollection(this); }
/// <summary> /// Close the connection. /// </summary> public void Close() //IDbConnection.Close { if (this.connectionState == ConnectionState.Open) { try { this.vistaDBSQL.Dispose(); } finally { this.vistaDBSQL = null; this.connectionState = ConnectionState.Closed; } } }
/// <summary> /// Constructor. /// </summary> public VistaDBConnection() { VistaDBErrorMsgs.SetErrorFunc(); this.connectionState = ConnectionState.Closed; this.accessMode = AccessMode.Local; this.vistaDBSQL = null; this.dataSource = null; this.database = null; this.cypher = CypherType.None; this.password = null; this.exclusive = false; this.readOnly = false; this.loginUser = ""; this.loginPassword = ""; }
/// <summary> /// Open the connection. /// </summary> public void Open() //IDbConnection.Open { #if EVAL if (license == null) { license = LicenseManager.Validate(typeof(VistaDBConnection), this); } #endif if (this.connectionState == ConnectionState.Open) { return; } if (DataSource == "") { throw new VistaDBException(VistaDBErrorCodes.ConnectionDataSourceIsEmpty); } switch (this.accessMode) { case AccessMode.Local: this.vistaDBSQL = new VistaDBLocalConnection(); break; case AccessMode.Remote: this.vistaDBSQL = new VistaDBRemoteConnection(); ((VistaDBRemoteConnection)this.vistaDBSQL).User = this.loginUser; ((VistaDBRemoteConnection)this.vistaDBSQL).LoginPassword = this.loginPassword; ((VistaDBRemoteConnection)this.vistaDBSQL).Timeout = this.connectionTimeOut; break; default: throw new VistaDBException(VistaDBErrorCodes.UnusableAccessMode); } this.vistaDBSQL.DataSource = this.dataSource; this.vistaDBSQL.Database = this.database; this.vistaDBSQL.Cypher = this.cypher; this.vistaDBSQL.Password = this.password; this.vistaDBSQL.Exclusive = this.exclusive; this.vistaDBSQL.ReadOnly = this.readOnly; vistaDBSQL.OpenDatabaseConnection(); connectionState = ConnectionState.Open; }
internal VistaDBConnection(int cultureID, bool caseSensitive) : this() { this.vistaDBSQL = new VistaDBLocalConnection(cultureID, caseSensitive); this.exclusive = true; this.connectionState = ConnectionState.Open; }
internal VistaDBConnection(int cultureID, bool caseSensitive): this() { this.vistaDBSQL = new VistaDBLocalConnection(cultureID, caseSensitive); this.exclusive = true; this.connectionState = ConnectionState.Open; }
/// <summary> /// Close the connection. /// </summary> public void Close()//IDbConnection.Close { if(this.connectionState == ConnectionState.Open) { try { this.vistaDBSQL.Dispose(); } finally { this.vistaDBSQL = null; this.connectionState = ConnectionState.Closed; } } }
/// <summary> /// Open the connection. /// </summary> public void Open()//IDbConnection.Open { #if EVAL if(license == null) license = LicenseManager.Validate(typeof(VistaDBConnection), this); #endif if(this.connectionState == ConnectionState.Open) return; if (DataSource=="") throw new VistaDBException(VistaDBErrorCodes.ConnectionDataSourceIsEmpty); switch(this.accessMode) { case AccessMode.Local: this.vistaDBSQL = new VistaDBLocalConnection(); break; case AccessMode.Remote: this.vistaDBSQL = new VistaDBRemoteConnection(); ((VistaDBRemoteConnection)this.vistaDBSQL).User = this.loginUser; ((VistaDBRemoteConnection)this.vistaDBSQL).LoginPassword = this.loginPassword; ((VistaDBRemoteConnection)this.vistaDBSQL).Timeout = this.connectionTimeOut; break; default: throw new VistaDBException(VistaDBErrorCodes.UnusableAccessMode); } this.vistaDBSQL.DataSource = this.dataSource; this.vistaDBSQL.Database = this.database; this.vistaDBSQL.Cypher = this.cypher; this.vistaDBSQL.Password = this.password; this.vistaDBSQL.Exclusive = this.exclusive; this.vistaDBSQL.ReadOnly = this.readOnly; vistaDBSQL.OpenDatabaseConnection(); connectionState = ConnectionState.Open; }
public VistaDBRemoteQuery(VistaDBSQLConnection parent) : base(parent) { this.fetchCount = 100; this.parameterCollection = new RemoteParameterCollection(); this.queryID = 0; //srv_Prepare(); }
public VistaDBRemoteQuery(VistaDBSQLConnection parent): base(parent) { this.fetchCount = 100; this.parameterCollection = new RemoteParameterCollection(); this.queryID = 0;//srv_Prepare(); }