T
T Driver
Anyone have any idea how I can do the following?
I have a connection to an XML file on a site I do not control, getting
a string representation of the xml data that I can then feed to my
XmlDataSource object (CurrentXMLData):
Stream newStream =
myWebClient.OpenRead(myStringWebResource);
TextReader newReader = new StreamReader(newStream);
string newData = newReader.ReadToEnd();
CurrentXMLData.Data = newData;
Now, I want to use the stream above as an argument for another method
- but the stream is at the end and doesn't support seeking.
SReader SReader = new SFileReader(newStream); //
EndOfStream is true! so object never initializes.
The SFileReader object will support any inputs that ReadXml on a
dataset will support (XmlReader, TextReader, string filename and
Stream)
The TextReader and XmlReader don't support seeking either.
The only way I've found to do this is to re-open the stream and re-
read - which is very time consuming.
Any ideas on how I can re-use the data in CurrentXMLData, newData or
newStream to populate my SFileReader object?
Thanks in advance,
Ted
I have a connection to an XML file on a site I do not control, getting
a string representation of the xml data that I can then feed to my
XmlDataSource object (CurrentXMLData):
Stream newStream =
myWebClient.OpenRead(myStringWebResource);
TextReader newReader = new StreamReader(newStream);
string newData = newReader.ReadToEnd();
CurrentXMLData.Data = newData;
Now, I want to use the stream above as an argument for another method
- but the stream is at the end and doesn't support seeking.
SReader SReader = new SFileReader(newStream); //
EndOfStream is true! so object never initializes.
The SFileReader object will support any inputs that ReadXml on a
dataset will support (XmlReader, TextReader, string filename and
Stream)
The TextReader and XmlReader don't support seeking either.
The only way I've found to do this is to re-open the stream and re-
read - which is very time consuming.
Any ideas on how I can re-use the data in CurrentXMLData, newData or
newStream to populate my SFileReader object?
Thanks in advance,
Ted