次の方法で共有


DataSourceAttribute Constructors

Definition

Overloads

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)

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)

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)

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.

public:
 DataSourceAttribute(System::String ^ dataSourceSettingName);
public DataSourceAttribute (string dataSourceSettingName);
new Microsoft.VisualStudio.TestTools.UnitTesting.DataSourceAttribute : string -> Microsoft.VisualStudio.TestTools.UnitTesting.DataSourceAttribute
Public Sub New (dataSourceSettingName As String)

Parameters

dataSourceSettingName
String

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

Applies to

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.

public:
 DataSourceAttribute(System::String ^ connectionString, System::String ^ tableName);
public DataSourceAttribute (string connectionString, string tableName);
new Microsoft.VisualStudio.TestTools.UnitTesting.DataSourceAttribute : string * string -> Microsoft.VisualStudio.TestTools.UnitTesting.DataSourceAttribute
Public Sub New (connectionString As String, tableName As String)

Parameters

connectionString
String

Data provider specific connection string. WARNING: 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.

tableName
String

The name of the data table.

Applies to

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.

public:
 DataSourceAttribute(System::String ^ providerInvariantName, System::String ^ connectionString, System::String ^ tableName, Microsoft::VisualStudio::TestTools::UnitTesting::DataAccessMethod dataAccessMethod);
public DataSourceAttribute (string providerInvariantName, string connectionString, string tableName, Microsoft.VisualStudio.TestTools.UnitTesting.DataAccessMethod dataAccessMethod);
new Microsoft.VisualStudio.TestTools.UnitTesting.DataSourceAttribute : string * string * string * Microsoft.VisualStudio.TestTools.UnitTesting.DataAccessMethod -> Microsoft.VisualStudio.TestTools.UnitTesting.DataSourceAttribute
Public Sub New (providerInvariantName As String, connectionString As String, tableName As String, dataAccessMethod As DataAccessMethod)

Parameters

providerInvariantName
String

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

connectionString
String

Data provider specific connection string. WARNING: 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.

tableName
String

The name of the data table.

dataAccessMethod
DataAccessMethod

Specifies the order to access data.

Applies to