Catch Stream as a String

  • Thread starter Thread starter Rohit Sharma
  • Start date Start date
R

Rohit Sharma

Hi All,

I want to catch a stream as a string.....please see below:

Dim stXML As Stream
Dim sReturn as string
dsResult.WriteXml(stXML)

I want the value of the stream stXML as a string. stXML is a stream.

Thanks in anticipation.
Regards
Rohit
 
Rohit,
Have you considered using a StreamReader to read the Stream?

Something like (untested):
Dim stXML As Stream
Dim reader As New StreamReader(stXML)
Dim sReturn as string
sReturn = reader.ReadToEnd()

Hope this helps
Jay
 

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

Back
Top