Microsoft SQL
This section describes how to start up an instance of a Microsoft SQL Server database.

Creating a SQL Server instance.

Create a new instance of Bard.Db.MsSqlDatabase passing in the database name, SA Password, port number, tag version.
1
var db = new MsSqlDatabase(
2
"BardDB_SQL_2017",
3
"Password1",
4
"1066",
5
"2017-latest");
Copied!
Port number, and tag are optional. If they are not supplied then the default value is
2019-latest & 1433

Starting up the Database

To start the database instance simply call either. The result is the IP address of the host machine in case this is needed in the connection string.
Sync
Async
1
var result = db.StartDatabase();
Copied!
1
var result = await db.StartDatabaseAsync();
Copied!
This may take a little time the first time as Docker needs to download the image in the background.

Stopping the Database

To stop the database simply call.
Sync
Async
1
db.StopDatabase();
Copied!
1
db.StopDatabaseAsync();
Copied!
Last modified 1yr ago