DataReader Output as XML

B

binder

Can a DataReader output XML directly similar to the functionality
offered by a DataSet?
I have a C# Web Service that returns read-only data and I would like to
output it as an XML string without using the overhead of a DataSet.
 
S

sloan

I think you'd have to do roll your own XmlWriter to accomplish this.
I'd say that for 1.1.

For 2.0, I ~think there is a "Create a DataSet from a IDataReader", which
might be fast enough.

I don't think Microsoft is doing any fairy magic behind the scenes.
Somewhere, there is a loop over an IDataReader, populating xml.
If you want speed, then an IDataReader coupled with an XmlWriter would be
where I first went.

...

This might get you started:
http://www.codeproject.com/aspnet/SquaredRomiss.asp
 

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

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,832
Latest member
UtaHetrick

Latest Threads

Top