473,396 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

DataReader Output as XML

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.

Aug 9 '06 #1
2 1650

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
"binder" <rg******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
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.

Aug 9 '06 #2
This article
http://www.topxml.com/sqlxml/xml_ena...data_layer.asp

also makes note that

"Best performance" but "Highest Maintenance".

...


"sloan" <sl***@ipass.netwrote in message
news:uK**************@TK2MSFTNGP04.phx.gbl...
>
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
"binder" <rg******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
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.


Aug 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Yasutaka Ito | last post by:
Hi, My friend had a little confusion about the working of DataReader after reading an article from MSDN. Following is a message from him... <!-- Message starts --> I was going thru DataReader...
2
by: Martin Raychev | last post by:
Hi all, I have the following problem: I have a private method that returns a SqlDataReader. For this to work I have not to close the DB connection in the above method. I do this only to
20
by: Mark | last post by:
Hi all, quick question , a DataView is memory resident "view" of data in a data table therefore once populated you can close the connection to the database. Garbage collection can then be used to...
1
by: John Smith | last post by:
I am using .NetFramework 1.1. and SQL2K. I am calling a stored procedure and it has multiple results set and some output parameters. If the output parameter does not meet certain condition,...
3
by: tshad | last post by:
I am trying to set up a class to handle my database accesses. I can't seem to figure out how to get the return value from my dataReader from these routines (most of which I got elsewhere). They...
1
by: Brent | last post by:
I'm having a hard time wrapping my head around how to build a multi-dimensional array of n length out of a DataReader loop. Take this pseudo-code: ======================================= public...
3
by: Alex Maghen | last post by:
Hi. I have a whole bunch of queries that I'll be running and returning in OleDbDataReader objects. Some of these DataReaders will just be a simple singe table result and others will be more complex...
6
by: dejavue82 | last post by:
This is the result of a JOINed query: question answer 1 a1 1 a2 1 a3 1 a4 2 a1 2 a2
8
by: Mike P | last post by:
How do you return a datareader from a stored procedure, but also return an output parameter? Here is my code, which is just returning a data reader at the moment : _conn.Open(); SqlCommand...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.