VistaDB 5
Example 






The connection used to open the VistaDB database.
VistaDBConnection Constructor(String)
Initializes a new instance of the VistaDBConnection class when given a string that contains the connection string.

It is considered a best practice to close the connection as soon as you are finished with it. Do NOT place the .Close() call in a Finalizer or object destructor. Both of those are non-deterministic (you cannot predict when or if they will be called). This leads to connection handle leaks over the lifetime of an application.

Syntax
'Declaration
 
Public Function New( _
   ByVal connectionString As System.String _
)
'Usage
 
Dim connectionString As System.String
 
Dim instance As New VistaDBConnection(connectionString)
public VistaDBConnection( 
   System.string connectionString
)
public VistaDBConnection( 
    connectionString: System.String
); 
public function VistaDBConnection( 
   connectionString : System.String
);
public: VistaDBConnection( 
   System.string* connectionString
)
public:
VistaDBConnection( 
   System.String^ connectionString
)

Parameters

connectionString
The connection used to open the VistaDB database.
Remarks

If you have a connection with connection pooling enabled and you wish to close all of them call the static function VistaDBConnection.ClearAllPools();

To clear a single pool instance you call the static function VistaDBConnection.ClearPool( myConnection ); Where myConnection is a properly initialized VistaDBConnection object.

Example
The following example creates and opens a VistaDBConnection.

If you have a connection with connection pooling enabled and you wish to close all of them call the static function VistaDBConnection.ClearAllPools();

To clear a single pool instance you call the static function VistaDBConnection.ClearPool( myConnection ); Where myConnection is a properly initialized VistaDBConnection object.

public VistaDBConnection OpenConnection(string connectionString)
{
	VistaDBConnection connection = new VistaDBConnection(connectionString);
	connection.Open();
	return connection;
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also