473,387 Members | 1,798 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,387 software developers and data experts.

Writing XML from Dataset to Response Object as Binary File

I have looked fot his solution, but Im not sure what to search for.

I have an asp.net based report. I need the user to be able to download
an XML file of the results so they can use the data in Excel, etc.

I do NOT want to write the file to the server first. I just want to be
able to write the contents of the Dataset into a binary file and send
it back out to the user as a download, but all in memory.

Can you give me a boost in the right direction or an article that
demonstrates this?

Dan

Nov 12 '05 #1
3 1880


Hanover wrote:

I have an asp.net based report. I need the user to be able to download
an XML file of the results so they can use the data in Excel, etc.

I do NOT want to write the file to the server first. I just want to be
able to write the contents of the Dataset into a binary file and send
it back out to the user as a download, but all in memory.


XML is text and not binary so I am not sure why you ask about XML but
then say you want to write the dataset into a binary file.
If you have an instance of System.Data.DateSet then it has a WriteXml
method with various overloads, one takes a Stream instance so in ASP.NET
you should just be able to do e.g.
dataSetInstance.WriteXml(Page.Response.OutputStrea m)

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #2
There is a really nice way to dump data out as xls stream found here..

http://www.experts-exchange.com/Prog..._21055376.html

Nov 12 '05 #3
Thanks! I actually found a way to dump it directly into an Excel
File...our execs like that much better. :)

Nov 15 '05 #4

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

Similar topics

6
by: Sebastian Kemi | last post by:
How should a write a class to a file? Would this example work: object *myobject = 0; tfile.write(reinterpret_cast<char *>(myobject), sizeof(*object)); / sebek
8
by: Deepa | last post by:
I am writing a console app in c# wherein am converting a dataset into a CSV file. It works fine. But I have some values in the dataset which have a comma within(eg. A,B,C). When I view the CSV file...
4
by: Simon | last post by:
Hi all, I have a process, where I take a dataset from an SQL call, and need to write an XML file from that dataset. The data set can contain 10's of tables, each with 100's of rows, and I have...
4
by: Brian Keating | last post by:
wonder if anyone can help me here, i've a framework 1.1 dataset which i serialize in framework 1.1 and deserialize in framework 2.0. This is fine, problem is that i want to modify some of the...
7
by: mahendranepali | last post by:
I am making a simulator application that will simulate different concurrent users connecting to a database. the application creates different userkeys and pushes them to the database tables. The...
7
by: Dan Sikorsky | last post by:
How do you iterate thru a dataset to change money fields to a different value? Here's what I have. My dataset is filled directly from a stored procedure. ' Create Instance of Connection and...
5
by: moondaddy | last post by:
I'm caching a dataset in an asp.net session variable to hold a user's data. one data item I need to store is an image the user uploaded. My problem is that I don't know how to get the image into...
0
by: kageyone | last post by:
I am having trouble updating a dataset representation of an xml file. The xml file is read into a dataset which is bound to a gridview control. The edit functionality was added to the code and...
4
by: K Viltersten | last post by:
I have designed a method that returns a DataSet object. Based on that, i create a DOC file and then return it to the client as follows. Response.Clear(); Response.AddHeader(...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.