Share via


NameAttribute Class

Specifies the string literal name of a given connection property when specified in a connection string.

Namespace:  Microsoft.VisualStudio.Data.Framework
Assembly:  Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)

Syntax

'Declaration
<AttributeUsageAttribute(AttributeTargets.Property)> _
Public NotInheritable Class NameAttribute _
    Inherits Attribute
'Usage
Dim instance As NameAttribute
[AttributeUsageAttribute(AttributeTargets.Property)]
public sealed class NameAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Property)]
public ref class NameAttribute sealed : public Attribute
public final class NameAttribute extends Attribute

Remarks

Use this class to work around restrictions on the naming of properties on classes (for example, they cannot contain spaces). A DDEX provider should apply this attribute to any connection property for which these restrictions create problems.

For example, the connection string for the Microsoft SQL Server data provider includes a property called Integrated Security. In a class, this must be named IntegratedSecurity because properties cannot contain spaces; thus, this attribute is used to define the correct name in the connection string as Integrated Security.

Inherits from Attribute class.

Inheritance Hierarchy

System.Object
  System.Attribute
    Microsoft.VisualStudio.Data.Framework.NameAttribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

NameAttribute Members

Microsoft.VisualStudio.Data.Framework Namespace