ConnectionContext Class

 

Represents the context for the database connection that is associated with the database unit test.

Namespace:   Microsoft.Data.Tools.Schema.Sql.UnitTesting
Assembly:  Microsoft.Data.Tools.Schema.Sql.UnitTesting (in Microsoft.Data.Tools.Schema.Sql.UnitTesting.dll)

System.Object
  Microsoft.Data.Tools.Schema.Sql.UnitTesting.ConnectionContext

public class ConnectionContext : IDisposable

NameDescription
System_CAPS_pubmethodConnectionContext()

Initializes a new instance of the ConnectionContext class.

NameDescription
System_CAPS_pubpropertyCommandTimeout

Gets or sets the time (in seconds) that elapses before the command that executes the batch statement times out.

System_CAPS_pubpropertyConnection

Gets or sets the database connection.

System_CAPS_pubpropertyProvider

Gets or sets a provider that is associated with the connection.

System_CAPS_pubpropertyTransaction

Gets or sets the transactions to use when executing the Transact-SQL statements.

NameDescription
System_CAPS_pubmethodDispose()

Releases resources used by a connection.

System_CAPS_protmethodDispose(Boolean)

Releases the unmanaged resources used by the connection and, optionally, releases the managed resources.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

This class provides connection and execution information to the Execute method when the Transact-SQL is executed. ConnectionContext uses types in the System.Data.Common namespace, regardless of database type.

Use this type to store the state of an open connection for later use. For example, you can save the impersonation context from an open connection if you want to use the same connection string and Windows authentication with two sets of Windows credentials. For more information, see Impersonate. You must release the context in the Dispose method.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: