DataSourceAttribute Class

Definition

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

C++
public ref class DataSourceAttribute sealed : Attribute
Inheritance
DataSourceAttribute
Attributes

Examples

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

Remarks

Constructors

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.

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)

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.

Fields

DefaultDataAccessMethod

The default data access method.

DefaultProviderName

The default provider name for DataSource.

Properties

ConnectionString

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

DataAccessMethod

Gets the method used to access the data source.

DataSourceSettingName

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

ProviderInvariantName

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

TableName

Gets a value indicating the table name providing data.

Applies to

Produit Versions
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0