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.
Submits the contents of a Stream object to the application database.
Espacio de nombres: Microsoft.SqlServer.NotificationServices
Ensamblado: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)
Sintaxis
'Declaración
Public Function LoadXml ( _
eventStream As Stream _
) As Integer
public int LoadXml (
Stream eventStream
)
public:
int LoadXml (
Stream^ eventStream
)
public int LoadXml (
Stream eventStream
)
public function LoadXml (
eventStream : Stream
) : int
Parámetros
- eventStream
A Stream object containing the XML event data to be loaded. This parameter cannot be null.
Valor devuelto
An integer specifying how many events have been submitted in this LoadXml call.
Notas
This method can take an object of any of the classes that inherit from the Stream class as its input parameter. However, not all of these classes are truly applicable. The classes that are compatible with this method are:
The Stream class itself is abstract, which means that it cannot be used directly. Instead, it serves as a base class from which other classes can be derived.
Ejemplo
The following examples show how to use the LoadXml method to submit XML event data from a Stream object to the application database:
Dim instanceName As String = "MyInstanceName"
Dim applicationName As String = "MyApplicationName"
Dim eventClassName As String = "MyEventClassName"
Dim eventProviderName As String = "MyEventProviderName"
Dim eventSchema As String = "MySchemaFilePathAndName"
Dim myXmlFile As String = "MyXMLFilePathAndName"
'Create an NSInstance object.
Dim myInstance As New NSInstance(instanceName)
'Create an NSApplication object.
Dim myApplication As New NSApplication(myInstance, applicationName)
'Create an EventLoader object.
Dim myEventLoader As New EventLoader(myApplication, _
eventProviderName, eventClassName, eventSchema)
'Use the LoadXml method to load an XML document.
Dim myStream As New System.IO.FileStream(myXmlFile, _
System.IO.FileMode.Open)
Dim eventsWritten As Integer = myEventLoader.LoadXml(myStream)
string instanceName = "MyInstanceName";
string applicationName = "MyApplicationName";
string eventClassName = "MyEventClassName";
string eventProviderName = "MyEventProviderName";
string eventSchema = "MySchemaFilePathAndName";
string myXmlFile = "MyXMLFilePathAndName";
//Create an NSInstance object.
NSInstance myInstance = new NSInstance(instanceName);
//Create an NSApplication object.
NSApplication myApplication =
new NSApplication(myInstance, applicationName);
//Create an EventLoader object.
EventLoader myEventLoader =
new EventLoader(myApplication, eventProviderName,
eventClassName, eventSchema);
//Use the LoadXml method to load an XML document.
System.IO.FileStream myStream =
new System.IO.FileStream(myXmlFile,
System.IO.FileMode.Open);
int eventsWritten = myEventLoader.LoadXml(myStream);
Seguridad para subprocesos
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.
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
EventLoader Class
EventLoader Members
Microsoft.SqlServer.NotificationServices Namespace