Share via


Subscription.Item Property (String)

Gets or sets the value of a field in the subscription record, using the field name as an identifier.

Spazio dei nomi: Microsoft.SqlServer.NotificationServices
Assembly : Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)

Sintassi

'Dichiarazione
<ComVisibleAttribute(True)> _
Public Default Property Item ( _
    fieldName As String _
) As Object
[ComVisibleAttribute(true)] 
public Object this [
    string fieldName
] { get; set; }
[ComVisibleAttribute(true)] 
public:
virtual property Object^ default [String^] {
    Object^ get (String^ fieldName) sealed;
    void set (String^ fieldName, Object^ value) sealed;
}
/** @property */
public final Object get_Item (String fieldName)

/** @property */
public final void set_Item (String fieldName, Object value)

Parametri

  • fieldName
    The name of the subscription field for which you want the value returned.

Valore proprietà

An Object that represents the field's value.

Esempio

The following examples show how to use the Item property to set a field value:

Dim instanceName As String = "MyInstanceName"
Dim applicationName As String = "MyApplicationName"
Dim subscriptionClassName As String = "MySubscriptionClassName"
Dim subscriptionFieldName As String = "MySubscriptionFieldName"

'Create an NSInstance object.
Dim myInstance As New NSInstance(instanceName)

'Create an NSApplication object.
Dim myApplication As New NSApplication(myInstance, applicationName)

'Create a Subscription object.
Dim mySubscription As _
    New Subscription(myApplication, subscriptionClassName)

'Use the Item property to set a field value.
mySubscription(subscriptionFieldName) = "MyValue"
string instanceName = "MyInstanceName";
string applicationName = "MyApplicationName";
string subscriptionClassName = "MySubscriptionClassName";
string subscriptionFieldName = "MySubscriptionFieldName";

//Create an NSInstance object.
NSInstance myInstance = new NSInstance(instanceName);

//Create an NSApplication object.
NSApplication myApplication = 
    new NSApplication(myInstance, applicationName);

//Create a Subscription object.
Subscription mySubscription = 
    new Subscription(myApplication, subscriptionClassName);

//Use the Item property to set a field value.
mySubscription[subscriptionFieldName] = "MyFieldValue";

Thread Safety

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

Piattaforme

Piattaforme di sviluppo

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Piattaforme di destinazione

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Vedere anche

Riferimento

Subscription Class
Subscription Members
Microsoft.SqlServer.NotificationServices Namespace