Each connection builder instance has a database provider and connection string, which cannot be changed after it's created. It can in turn create a single AdbConnection database connection, for use with a single worker.
This class opens and closes connections in the same way as the underlying .NET
DbConnection, and is
the normal type of connection to use for database access. AdbKeepOpenConnection is available
for the (rare) cases when a connection should stay open across multiple workers.
public sealed class AdbConnectionBuilder : AdbConnectionBuilderBase, IAdbConnectionBuilder
Do design database workers to take
AdbCommandBuilder instances as parameters, which allows
them to support connections with different AdbConnectionMode. Conversely,
or connection (text) strings to workers.
AdbConnectionBuilder Example demonstrates how to use this class.
Creates an Adb database connection, using the connection details of the
AdbConnection instance is not thread-safe, and must only be used
in a single place (in a single worker) at any one time.
The connection can be opened and closed multiple times as needed, and it must
be disposed after use. Disposal should almost always be done by whoever created the
connection, typically via
or UsingActionWorker<TDisposable> if used across multiple method calls,
or by a
using statement if created and disposed in a single method and thread, without
being passed to any other workers.
See Disposing Disposables for details.
public override IAdbConnection Create()
The Adb connection.
Bad ConnectionString format.