P
Porgányi Géza
Hi!
Before in ADO I used to get data from database with the technic below:
Stored procedure:
SELECT N'<XML><Data1>'
SELECT N'<Item>' + fField1 + '</Item>' FROM tbXXX WHERE ....
SELECT N'</Data1><Data2>'
SELECT N'<Item>' + fField2 + '</Item>' FROM tbYYY WHERE ....
SELECT N'</Data2>'
SELECT N'</XML>'
It results a well form structured XML. I could read it like this:
Dim adoConn as new ADODB.Connection
Dim adoCmd as new ADODB.Command
Dim adoStream as new ADODB.Stream
.....
adoStream.Open
adoCmd.Properties("Output Stream").value = adoStream
adocmd.Execute , , adExecuteStream
strTemp = adoStream.ReadText
In ADO.NET I can use ExecuteXMLReader to get xml string back, but it works
only with SELECT....FOR XML...., not with my generated one. It says it is
not a xml.
Is there a solution to use my old sps in .NET?
Before in ADO I used to get data from database with the technic below:
Stored procedure:
SELECT N'<XML><Data1>'
SELECT N'<Item>' + fField1 + '</Item>' FROM tbXXX WHERE ....
SELECT N'</Data1><Data2>'
SELECT N'<Item>' + fField2 + '</Item>' FROM tbYYY WHERE ....
SELECT N'</Data2>'
SELECT N'</XML>'
It results a well form structured XML. I could read it like this:
Dim adoConn as new ADODB.Connection
Dim adoCmd as new ADODB.Command
Dim adoStream as new ADODB.Stream
.....
adoStream.Open
adoCmd.Properties("Output Stream").value = adoStream
adocmd.Execute , , adExecuteStream
strTemp = adoStream.ReadText
In ADO.NET I can use ExecuteXMLReader to get xml string back, but it works
only with SELECT....FOR XML...., not with my generated one. It says it is
not a xml.
Is there a solution to use my old sps in .NET?