Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
Creates and initializes an instance of the Event class.
Espacio de nombres: Microsoft.SqlServer.NotificationServices
Ensamblado: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)
Sintaxis
'Declaración
Public Sub New ( _
nsApplication As NSApplication, _
eventClassName As String _
)
public Event (
NSApplication nsApplication,
string eventClassName
)
public:
Event (
NSApplication^ nsApplication,
String^ eventClassName
)
public Event (
NSApplication nsApplication,
String eventClassName
)
public function Event (
nsApplication : NSApplication,
eventClassName : String
)
Parámetros
- nsApplication
An NSApplication that represents the Notification Services application for the event.
Notas
It is possible to construct an Event without initializing it with an NSApplication. In this case, the event class is not verified, and event field names must be hard-coded. This can be useful in cases where you would like to use an Event in an application that does not have a direct connection to a Notification Services server, for example in a disconnected Message Queuing (also known as MSMQ) scenario. For more information about using an Event in this way, see Usar la API administrada de envío de eventos.
Ejemplo
The following examples show how to create and initialize an Event in managed code.
These examples use the Microsoft.SqlServer.NotificationServices namespace.
Dim instanceName As String = "MyInstanceName"
Dim applicationName As String = "MyApplicationName"
Dim eventClassName As String = "MyEventClassName"
'Create an NSInstance object.
Dim myInstance As New NSInstance(instanceName)
'Create an NSApplication object.
Dim myApplication As New NSApplication(myInstance, applicationName)
'Create an Event object.
Dim myEvent As New Microsoft.SqlServer.NotificationServices.Event( _
myApplication, eventClassName)
string instanceName = "MyInstanceName";
string applicationName = "MyApplicationName";
string eventClassName = "MyEventClassName";
//Create an NSInstance object.
NSInstance myInstance = new NSInstance(instanceName);
//Create an NSApplication object.
NSApplication myApplication =
new NSApplication(myInstance, applicationName);
//Create an Event object.
Event myEvent = new Event(myApplication, eventClassName);
Plataformas
Plataformas de desarrollo
Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.
Plataformas de destino
Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.
Vea también
Referencia
Event Class
Event Members
Microsoft.SqlServer.NotificationServices Namespace