Share via


Instance Constructor ()

Initializes a new instance of the Instance class.

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

Syntax

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

Remarks

Updated text:5 December 2005

Updated sample code:5 December 2005

If you use the default constructor, you must immediately set the Name property and then set the Parent property. You can then set other properties.

The default constructor does not set default property values. You must set the SchemaName and EncryptArguments settings.

Example

The following examples show how to use this default constructor:

// Create instance and set required properties.
Instance myInstance = new Instance();
myInstance.Name = instanceName;
myInstance.Parent = notificationServices;
myInstance.SchemaName = "dbo";
myInstance.EncryptArguments = false;
' Create instance and set required properties.
Dim myInstance As Instance = New Instance()
myInstance.Name = instanceName
myInstance.Parent = notificationServices
myInstance.SchemaName = "dbo"
myInstance.EncryptArguments = False

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

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

Other Resources

Configuring Instances of Notification Services
NotificationServicesInstance Element (ICF)