DataSourceAttribute DataSourceAttribute DataSourceAttribute Class

Definition

Specifies connection string, table name and row access method for data driven testing.

[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false)]
public sealed class DataSourceAttribute : Attribute
type DataSourceAttribute = class
    inherit Attribute
Public NotInheritable Class DataSourceAttribute
Inherits Attribute
Inheritance
DataSourceAttributeDataSourceAttributeDataSourceAttribute
Attributes

Examples

[DataSource("Provider=SQLOLEDB.1;Data Source=source;Integrated Security=SSPI;Initial Catalog=EqtCoverage;Persist Security Info=False", "MyTable")] [DataSource("dataSourceNameFromConfigFile")]

Constructors

DataSourceAttribute(String) DataSourceAttribute(String) DataSourceAttribute(String)

Initializes a new instance of the DataSourceAttribute class. This instance will be initialized with a data provider and connection string associated with the setting name.

DataSourceAttribute(String, String) DataSourceAttribute(String, String) DataSourceAttribute(String, String)

Initializes a new instance of the DataSourceAttribute class.This instance will be initialized with a connection string and table name. Specify connection string and data table to access OLEDB data source.

DataSourceAttribute(String, String, String, DataAccessMethod) DataSourceAttribute(String, String, String, DataAccessMethod) DataSourceAttribute(String, String, String, DataAccessMethod)

Initializes a new instance of the DataSourceAttribute class. This instance will be initialized with a data provider, connection string, data table and data access method to access the data source.

Fields

DefaultDataAccessMethod DefaultDataAccessMethod DefaultDataAccessMethod

The default data access method.

DefaultProviderName DefaultProviderName DefaultProviderName

The default provider name for DataSource.

Properties

ConnectionString ConnectionString ConnectionString

Gets a value representing the connection string for the data source.

DataAccessMethod DataAccessMethod DataAccessMethod

Gets the method used to access the data source.

DataSourceSettingName DataSourceSettingName DataSourceSettingName

Gets the name of a data source found in the <microsoft.visualstudio.qualitytools> section in the app.config file.

ProviderInvariantName ProviderInvariantName ProviderInvariantName

Gets a value representing the data provider of the data source.

TableName TableName TableName

Gets a value indicating the table name providing data.

Applies to