This will be slower than the Dataset method. The reason the Dataset is slower for Web operations is the time it takes to build the Dataset object. Building an XML document will not be quick - though XML is great for batch updates.
Most performance tests with DataReader vs Datasets continually create new Datasets as you would do in a web environment. And the overhead of creating hundreds of datasets and their associated objects (DataTables , DataRows , DataRow collections , DataViews) is what takes doubles the time. None of them have Cached the Dataset there is merely a footnote under DataReader saying that you you should use DataSets if you fetch the information more than once. Remember if you read the data twice the Dataset will be just as efficient . Ben Kloosterman -----Original Message----- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED]]On Behalf Of Jeff Hughes Sent: Friday, 14 June 2002 11:50 AM To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] SqlDataReader Here is my dilemma. I want to be able to create an XML document using the SqlDataReader in place of a DataSet. I know you have to have the connection open the whole time while reading through the reader. The DataSet uses a reader to populate itself. I know the DataSet is much more expensive to use than the reader and the SqlDataReader is much faster. But, you cannot serialize the data from the reader. So, I want to read into an xml document. This document will then get transformed by the client to display properly. I know how to do everything except take the data from the reader and create a generic XML Document. I am using C# any help would be great. Thank you, Jeff Hughes [EMAIL PROTECTED] You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.