Class DatabaseConnectionInformation
Represents a database connection.
Namespace: MESL.SqlRace.Domain
Assembly: MESL.SqlRace.Domain.dll
Syntax
public class DatabaseConnectionInformation : ConnectionInformationBase
Remarks
Database connection strings are used for either a local or remote SQL Server instance. Example:
- Data Source=.\sqlexpress;Initial Catalog=SQLRACE01;Integrated Security=SSPI
Constructors
DatabaseConnectionInformation(String)
Initialises a new instance of the DatabaseConnectionInformation class.
Declaration
public DatabaseConnectionInformation(string connectionString)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | The connection string. |
Properties
ConnectionString
Gets the connection string.
Declaration
public override string ConnectionString { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
PortNumber
Not used for a DatabaseConnectionInformation
.
Declaration
public override int PortNumber { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown if called. |
RemoteIpAddress
Not used for a DatabaseConnectionInformation
.
Declaration
public override string RemoteIpAddress { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown if called. |
Methods
GetContextKey()
For a DatabaseConnectionInformation
, returns the database connection string.
Declaration
public override string GetContextKey()
Returns
Type | Description |
---|---|
System.String | Database connection string |
Overrides
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String that represents this instance. |