🃏
Bard.Db
  • Introduction
  • Installation
  • Databases
    • Microsoft SQL
    • PostgreSQL
Powered by GitBook
On this page
  • Creating a SQL Server instance.
  • Starting up the Database
  • Stopping the Database

Was this helpful?

Export as PDF
  1. Databases

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.

       var db = new MsSqlDatabase(
                "BardDB_SQL_2017",
                "Password1",
                "1066",
                "2017-latest");

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.

var result = db.StartDatabase();
var result = await db.StartDatabaseAsync();

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.

 db.StopDatabase();
db.StopDatabaseAsync();
PreviousInstallationNextPostgreSQL

Last updated 4 years ago

Was this helpful?