Share via


SubscriptionField Constructor ()

Initializes a new instance of the SubscriptionField class.

Namespace: Microsoft.SqlServer.Management.Nmo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntax

'Declaration
Public Sub New
public SubscriptionField ()
public:
SubscriptionField ()
public SubscriptionField ()
public function SubscriptionField ()

Remarks

Updated text:5 December 2005

Updated sample code:5 December 2005

When using the default constructor, first set the Name, then the Parent and then other properties, such as the required Type property, to avoid run-time exceptions.

Example

The following examples show how to use this default constructor to create a subscription field and then add it to a subscription class:

// Create a subscription field and set required properties.
SubscriptionField subDevice = new SubscriptionField();
subDevice.Name = "DeviceName";
subDevice.Parent = flightSubscriptions;
subDevice.Type = "nvarchar(255)";
subDevice.TypeModifier = "";
flightSubscriptions.SubscriptionFields.Add(subDevice);
' Create a subscription field and set required properties.
Dim subDevice As SubscriptionField = New SubscriptionField()
subDevice.Name = "DeviceName"
subDevice.Parent = flightSubscriptions
subDevice.Type = "nvarchar(255)"
subDevice.TypeModifier = ""
flightSubscriptions.SubscriptionFields.Add(subDevice)

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

See Also

Reference

SubscriptionField Class
SubscriptionField Members
Microsoft.SqlServer.Management.Nmo Namespace