I would like to return an xmldocument from a 2005 vb clr stored procedure.
This is my definition for the stored procedure. passing in a string, return xmldoc.
Can I not return an xmldoc as output? The solution will build, but not run.
Partial Public Class StoredProcedures
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Sub SP_Transform(ByVal cc As String, <Out()> ByVal RetValue As XmlDocument)
Error 1 Column, parameter, or variable #2: Cannot find data type XmlDocument. SqlServerProject1
Interesting question. I'll have to try it.
My gut, however, is that you should just return the XML data using the new Xml Data Type in SQL Server 2005 and just use a DataReader like dr.GetSqlXml(index) in ADO.NET to read the XML and load it into an XmlDocument.
I wrote an example of that here-
Reading XML Data Type into XmlDocument Using ADO.NET - SQL Server 2005 Tutorials
Regards,
Dave
No comments:
Post a Comment