XML From Store procedure HELP

T

Tiraman

Hi ,

I wrote a Stored procedure that return me an xml
some thing very simple (select * from XXX FOR XML AUTO)
and I would like to get the XML result into some string param in VB.NET .

then I would like to take this XML String and transform it with XSL and the
HTML result i would like so
hold in a string param (sHTML as string)

10x

V.Amir
 
M

[MSFT]

Hi Amir,

In ADO.NET, SqlCommand Object has a method named "ExecuteXmlReader" which
can return XML from a query like "select * from XXX FOR XML AUTO". For more
information on this issue, you may refer to:

HOW TO: Use the ExecuteXmlReader Method of the SqlCommand Class in Visual
Basic .NET
http://support.microsoft.com/?id=316016

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
T

Tiraman

Hi Luke ,

first 10x for your help .
2nd i looked for some thing else .
i know how to use the executexmlreader but i didn't know how to use the
StringWriter method
in order to get the html result from it after doing the transformation :)

any way i m ok now so

10x again .

Amir .
 
M

[MSFT]

Hi Amir,

You can use the ReadOuterXml Method of XMLReader class. It will return a
string for XML data. For example:

xmlr = cmd.ExecuteXmlReader()
xmlr.Read()

Dim XMLString as String

Do While xmlr.ReadState <> Xml.ReadState.EndOfFile
XMLString=XMLString+ xmlr.ReadOuterXml()
Loop

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top