| title | SQLXML Managed Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| description | Learn about Microsoft SQLXML Managed Classes that expose the functionality of SQLXML 4.0 inside the Microsoft .NET Framework. | |||||||||||
| author | MikeRayMSFT | |||||||||||
| ms.author | mikeray | |||||||||||
| ms.date | 03/14/2017 | |||||||||||
| ms.service | sql | |||||||||||
| ms.subservice | xml | |||||||||||
| ms.topic | reference | |||||||||||
| helpviewer_keywords |
|
|||||||||||
| monikerRange | =azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDE SQL Server Azure SQL Database] [!INCLUDEmsCoName] SQLXML 4.0 supports features that allow you to write applications to access XML data from an instance of [!INCLUDEssNoVersion], bring the data into the [!INCLUDEmsCoName] .NET Framework environment, process the data, and send the updates back to [!INCLUDEssNoVersion].
[!INCLUDEmsCoName] SQLXML Managed Classes exposes the functionality of SQLXML 4.0 inside the [!INCLUDEmsCoName] .NET Framework. With SQLXML Managed Classes, you can write a C# application to access XML data from an instance of [!INCLUDEssNoVersion], bring the data into the .NET Framework environment, process the data, and send the updates back to [!INCLUDEssNoVersion] as a DiffGram to apply the updates. You must use a mapping schema when applying updates to a [!INCLUDEssNoVersion] database using SQLXML Managed Classes. For a working sample, see Accessing SQLXML Functionality in the .NET Environment.
To use the SQLXML Managed Classes with SQLXML 4.0, you must install Microsoft Visual Studio.
Note
The .NET Framework includes the [!INCLUDEssNoVersion] .NET Data Provider. This provider can be used to access [!INCLUDEssNoVersion] from the .NET environment; however, it can handle only traditional SQL queries (that is, relational database queries with the exception of FOR XML queries). You cannot execute XML templates or the server-side XPath queries in [!INCLUDEssNoVersion].
For information about accessing and modifying data in [!INCLUDEssNoVersion] within the [!INCLUDEmsCoName] .NET Framework, and about using DiffGrams to update data in [!INCLUDEssNoVersion] tables, see Accessing SQLXML Functionality in the .NET Environment.
Note
You can also write [!INCLUDEmsCoName] Visual Studio applications to bulk load XML documents by using XML Bulk Load. For more information, see Performing Bulk Load of XML Data (SQLXML 4.0). You must add a reference to the XML Bulk Load DLL (Xblkld4.dll) in your application. This is a COM DLL for which Visual Studio .NET automatically creates the wrapper library.
This section provides sample applications that demonstrate how to use the [!INCLUDEmsCoName] SQLXML Managed Classes:
Executing SQL Queries (SQLXML Managed Classes)
Executing SQL Queries by Using the ExecuteXMLReader Method
Processing XML on the Client Side (SQLXML Managed Classes)
Executing XPath Queries (SQLXML Managed Classes)
Executing XPath Queries with Namespaces (SQLXML Managed Classes)
Executing Template Files by Using the CommandText Property
Executing Template Files by Using the CommandStream Property
Applying an XSL Transformation (SQLXML Managed Classes)