SqlServerContainer Class

A temporary SQL Server container. Obtain one from SqlServerContainerDefinition.CreateContainer.

public sealed class SqlServerContainer : TemporaryContainer
Inheritance
TemporaryContainer SqlServerContainer

Methods

NameDescription
GetConnectionString()Gets a SQL Server connection string for the running container (on TemporaryContainer.GetHostAddress), using credentials from the definition's environment variables (MSSQL_SA_PASSWORD).

GetConnectionString()

SqlServerContainer.cs

Gets a SQL Server connection string for the running container (on TemporaryContainer.GetHostAddress), using credentials from the definition's environment variables (MSSQL_SA_PASSWORD).

public string GetConnectionString()

Returns

string The connection string.

Exceptions

InvalidOperationException
The container has not been started.