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;
		}
Example #2
0
        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;
        }
Example #3
0
        public VistaDBSQLQuery(VistaDBSQLConnection p)
        {
            rowsAffected = 0;
            recordCount  = 0;
            commandText  = "";
            columnCount  = 0;
            password     = "";
            errorNumber  = 0;
            parent       = p;
            opened       = false;

            Columns = new VistaDBColumnCollection(this);
        }
Example #4
0
 /// <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;
         }
     }
 }
Example #5
0
        /// <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>
		/// 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   = "";
		}
Example #7
0
        /// <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;
        }
Example #8
0
 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;
		}
Example #10
0
		/// <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;
				}
			}
		}
Example #11
0
		/// <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 VistaDBSQLQuery(VistaDBSQLConnection p)
		{
			rowsAffected = 0;
			recordCount = 0;
			commandText = "";
			columnCount = 0;
			password = "";
			errorNumber = 0;
			parent = p;
			opened = false;

			Columns = new VistaDBColumnCollection(this);
		}
Example #13
0
 public VistaDBRemoteQuery(VistaDBSQLConnection parent) : base(parent)
 {
     this.fetchCount          = 100;
     this.parameterCollection = new RemoteParameterCollection();
     this.queryID             = 0;            //srv_Prepare();
 }
Example #14
0
		public VistaDBRemoteQuery(VistaDBSQLConnection parent): base(parent)
		{
			this.fetchCount          = 100;
			this.parameterCollection = new RemoteParameterCollection();
			this.queryID             = 0;//srv_Prepare();
		}