Share via


DataSink.ValidateTargetModel Method

Performs basic validation on the target database to ensure that it is possible to run the data generation plan on the target.

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

Syntax

'Declaration
Protected Function ValidateTargetModel ( _
    planModel As DataSchemaModel, _
    dgenServices As DataGenerationServices, _
    connString As String, _
    <OutAttribute> ByRef errors As List(Of DataSchemaError) _
) As Boolean
protected bool ValidateTargetModel(
    DataSchemaModel planModel,
    DataGenerationServices dgenServices,
    string connString,
    out List<DataSchemaError> errors
)
protected:
bool ValidateTargetModel(
    DataSchemaModel^ planModel, 
    DataGenerationServices^ dgenServices, 
    String^ connString, 
    [OutAttribute] List<DataSchemaError^>^% errors
)
member ValidateTargetModel : 
        planModel:DataSchemaModel * 
        dgenServices:DataGenerationServices * 
        connString:string * 
        errors:List<DataSchemaError> byref -> bool 
protected function ValidateTargetModel(
    planModel : DataSchemaModel, 
    dgenServices : DataGenerationServices, 
    connString : String, 
    errors : List<DataSchemaError>
) : boolean

Parameters

  • connString
    Type: System.String
    The target database connection string.

Return Value

Type: System.Boolean
true if the data sink can save to the target model; otherwise, false.

Exceptions

Exception Condition
ArgumentNullException

One or more of the input parameters is nulla null reference (Nothing in Visual Basic), or the connString parameter is an empty string.

Remarks

In a derived class, this ValidateTargetModel method can be called from the OnValidateTarget method, or it can implement an entirely new validation process.

The following are some of the basic validations performed by this method:

  • Verify that the selected tables are in the target.

  • Verify that the selected columns are in the target.

  • Verify that the assigned generators can be loaded.

  • Verify that the assigned generator is valid for the column type and is correctly configured.

.NET Framework Security

See Also

Reference

DataSink Class

Microsoft.Data.Schema.Tools.DataGenerator Namespace

DataSchemaModel

DataGenerationServices

DataSchemaError

ValidateTargetModel