VistaDB 5
Gibraltar VistaDB > Getting Started > Using VistaDB with Entity Framework > Using VistaDB with ADO.NET - Connection Strings
Using VistaDB with ADO.NET - Connection Strings

ADO.NET uses connection strings to specify what database to open and any options necessary for tuning the behavior of the engine and the connection.  Like all ADO.NET providers, VistaDB supports a number of options in its connection strings.  Connection strings are composed of one or more options specified as keyword=value followed by a semicolon(;)

Supported Connection String Options

Keyword Default Description
Compatibility Mode Normal

CompatibilityMode current setting for SQL Server Vs legacy VistaDB compatibility on this connection.  If specified, it must be one of the following values:

  • Normal: Non-breaking corrections and enhancements are incorporated in minor versions, but breaking changes wait for new major versions.
  • Strict: Client prefers strict SQL Server syntax.  Breaking changes to correct syntax incompatibilities may be added in any new release.
  • Legacy: Client relies on deprecated syntax features of VistaDB. 
Connect Timeout 0 The maximum time in seconds to wait for a valid connection. 
Data Source

The file name of the database to open.  If no directory is specified it will use the current working directory. 

To specify a full path or a name with spaces use single quotes (')

A special format is supported for web applications to map the App_Data directory. Note that no trailing slash is used after |DataDirectory|.

Isolated Storage False When True indicates the database resides in isolated storage.
Max Pool Size 100 Sets the maximum number of connections to be cached in the connection pool. This must be a positive number larger than the Minimum Pool Size.
Min Pool Size 1 Sets the minimum pool size for the connection. This must be a positive number smaller than Maximum Pool Size.
Open Mode NonExclusiveReadWrite The mode for opening the database. This should not be set to exclusive if connection pooling is enabled. It must be one of the following values:

  • ExclusiveReadWrite: Single user read / write. Connection pooling must be turned off (each connection pool entry counts as a connection - exclusive means only 1 connection, not one app).
  • ExclusiveReadOnly: Single user read only mode.
  • NonExclusiveReadWrite: Multi user read / write. This is probably the default you should use most of the time.
  • NonExclusiveReadOnly: Multi user read only - other clients may write to the database.
  • SharedReadOnly: Multi user read only for all clients.
Password The password must not be quoted or encoded.  It's recommended you place the password as the last item in the connection string so it doesn't require a trailing semicolon.
Pooling False Turn connection pooling on or off for the given connection.  True means enable pooling, False means disable. Used in conjunction with Min Pool Size and Max Pool Size.
Transaction Mode On

Indicates how the engine should treat attempts to use transactions.  If specified, it must be one of the following values:

  • On: Transaction support is on and operates normally.
  • Off: Transactions are disabled, any attempt to start one will thrown an exception.
  • Ignore: Transactions are disabled, any attempt to start or commit or abort one will be ignored.

For common examples, see Using VistaDB with ADO.NET - Using Connection Strings in Code.

See Also