Remarque
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
Gets or sets the value of an event data field in the event record, using the field name as an identifier.
Espace de noms: Microsoft.SqlServer.NotificationServices
Assembly: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)
Syntaxe
'Déclaration
Public Default Property Item ( _
fieldName As String _
) As Object
public Object this [
string fieldName
] { get; set; }
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)
Paramètres
- fieldName
The name of the event field.
Valeur de propriété
An Object that represents the field's value.
Exemple
The following example shows how to set the value of an event data field using the name of the field:
string instanceName = "Tutorial";
string applicationName = "Weather";
string eventClassName = "WeatherEvents";
string eventProviderName = "WeatherSPs";
// Create an NSInstance object.
NSInstance testInstance = new NSInstance(instanceName);
// Create an NSApplication object.
NSApplication testApplication =
new NSApplication(testInstance, applicationName);
// Create an EventCollector object.
EventCollector testEventCollector =
new EventCollector(testApplication, eventProviderName);
// Create and define an Event object.
Event evt = new Event(testApplication, eventClassName);
evt["City"] = "Seattle";
evt["Date"] = DateTime.Now;
evt["Low"] = 40;
evt["High"] = 50;
evt["Forecast"] = "Cloudy";
// Write the event to the event collector's batch
testEventCollector.Write(evt);
// Commit the event batch to the application database.
testEventCollector.Commit();
Sécurité des threads
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.
Plateformes
Plateformes de développement
Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.
Plateformes cibles
Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.
Voir aussi
Référence
Event Class
Event Members
Microsoft.SqlServer.NotificationServices Namespace