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)
Syntax
'Declaration
Public Sub New ( _
providerInvariantName As String, _
connectionString As String, _
tableName As String, _
dataAccessMethod As DataAccessMethod _
)
public DataSourceAttribute(
string providerInvariantName,
string connectionString,
string tableName,
DataAccessMethod dataAccessMethod
)
public:
DataSourceAttribute(
String^ providerInvariantName,
String^ connectionString,
String^ tableName,
DataAccessMethod dataAccessMethod
)
new :
providerInvariantName:string *
connectionString:string *
tableName:string *
dataAccessMethod:DataAccessMethod -> DataSourceAttribute
public function DataSourceAttribute(
providerInvariantName : String,
connectionString : String,
tableName : String,
dataAccessMethod : DataAccessMethod
)
Parameters
providerInvariantName
Type: StringInvariant data provider name, such as System.Data.SqlClient.
connectionString
Type: StringA data provider-specific connection string.
tableName
Type: StringThe name of the data table.
dataAccessMethod
Type: Microsoft.VisualStudio.TestTools.UnitTesting.DataAccessMethodSpecifies the order to access data. It takes a DataAccessMethod.
Remarks
Note
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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.