Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

DataSourceAttribute Constructor (String, String)

Initializes a new instance of the DataSourceAttribute class. This instance will be initialized with a connection string and table name.

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

public DataSourceAttribute(
	string connectionString,
	string tableName
)

Parameters

connectionString
Type: String

Data provider-specific connection string.

tableName
Type: String

The name of the data table.

It is important to note that properties are set at initialization for this object. This constructor overload uses the default value of System.Data.OleDb for the data provider name and uses the default value of Random for the data access method.

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.

Show:
© 2015 Microsoft