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
 
Back
Top