Condividi tramite


TSqlModel.LoadFromDatabaseWithAuthProvider Method

Definition

Loads a model from a database using the specified options.

public static Microsoft.SqlServer.Dac.Model.TSqlModel LoadFromDatabaseWithAuthProvider (string connectionString, Microsoft.SqlServer.Dac.IUniversalAuthProvider authProvider, Microsoft.SqlServer.Dac.Model.ModelExtractOptions options = default, System.Threading.CancellationToken? cancellationToken = default);
static member LoadFromDatabaseWithAuthProvider : string * Microsoft.SqlServer.Dac.IUniversalAuthProvider * Microsoft.SqlServer.Dac.Model.ModelExtractOptions * Nullable<System.Threading.CancellationToken> -> Microsoft.SqlServer.Dac.Model.TSqlModel
Public Shared Function LoadFromDatabaseWithAuthProvider (connectionString As String, authProvider As IUniversalAuthProvider, Optional options As ModelExtractOptions = Nothing, Optional cancellationToken As Nullable(Of CancellationToken) = Nothing) As TSqlModel

Parameters

connectionString
String

A connection string specifying the database and catalog to load.

authProvider
IUniversalAuthProvider

Optional universal authentication provider used to authenticate a SqlConnection when opening a connection.

options
ModelExtractOptions

Optional ModelExtractOptions instance used to specify options that affect the behavior of package extraction. For models to be analyzed in static code analysis, it's recommended that the LoadAsScriptBackedModel be set to true. This is important since some rules may not work as expected unless this is true.

cancellationToken
Nullable<CancellationToken>

Optional cancellation token used to cancel a load operation.

Returns

Exceptions

If connectionString is null.

If connectionString is not a valid connection string or options.Storage is not a valid value of the enumerated type.

If there are problems extracting the model from the specified database.

Applies to