DataSourceAttribute Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies connection string, table name and row access method for data driven testing.
public ref class DataSourceAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false)]
public sealed class DataSourceAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Method)]
public sealed class DataSourceAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false)>]
type DataSourceAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Method)>]
type DataSourceAttribute = class
inherit Attribute
Public NotInheritable Class DataSourceAttribute
Inherits Attribute
- Inheritance
-
DataSourceAttribute
- Attributes
[DataSource("Provider=SQLOLEDB.1;Data Source=source;Integrated Security=SSPI;Initial Catalog=EqtCoverage;Persist Security Info=False", "MyTable")] [DataSource("dataSourceNameFromConfigFile")].
Data |
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. |
Data |
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. |
Data |
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. |
Default |
The default data access method. |
Default |
The default provider name for DataSource. |
Connection |
Gets a value representing the connection string for the data source. |
Data |
Gets the method used to access the data source. |
Data |
Gets the name of a data source found in the <microsoft.visualstudio.qualitytools> section in the app.config file. |
Provider |
Gets a value representing the data provider of the data source. |
Table |
Gets a value indicating the table name providing data. |
Produto | Versões |
---|---|
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 |
Comentários do .NET
O .NET é um projeto código aberto. Selecione um link para fornecer comentários: