Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataSourceAttribute Constructor (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.

Namespace:   Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

public DataSourceAttribute(
	string providerInvariantName,
	string connectionString,
	string tableName,
	DataAccessMethod dataAccessMethod
)

Parameters

providerInvariantName
Type: System.String

Invariant data provider name, such as System.Data.SqlClient.

connectionString
Type: System.String

A data provider-specific connection string.

tableName
Type: System.String

The name of the data table.

dataAccessMethod
Type: Microsoft.VisualStudio.TestTools.UnitTesting.DataAccessMethod

Specifies the order to access data. It takes a DataAccessMethod.

System_CAPS_noteNote

The connection string can contain sensitive data (for example, a password). The connection string is stored in plain text in source code and in the compiled assembly. Restrict access to the source code and assembly to protect this sensitive information.

Return to top
Show: