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

How do I write XML from a dataset to Response, including schema?

Hello,

I am trying to write some XML from a DataSet out to the Response object,
but I'm getting somewhat stuck.

I started out with ...

strXmlData = dstData.GetXml();
Response.Write(strXmlData);

which was fine, except it doesn't include the schema. I then discovered
that I should have been using WriteXML instead of GetXML, as that allows
me to tell it add the schema.

This is where I got stuck. I can't work out what to use for the first
parameter of WriteXML. The second one is the WriteSchema flag, but what
do I use for the first?

I tried ...

dstData.WriteXml(Response, XmlWriteMode.WriteSchema);

thinking that maybe Response was really a stream, but that didn't work.

So, anyone know how to do this? I just want the most efficient way of
sending the XML including schema to Response.

TIA for any help

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #1
2 4305
Use Response.OutputStream :)

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hello,

I am trying to write some XML from a DataSet out to the Response
object, but I'm getting somewhat stuck.

I started out with ...

strXmlData = dstData.GetXml();
Response.Write(strXmlData);
which was fine, except it doesn't include the schema. I then
discovered that I should have been using WriteXML instead of GetXML,
as that allows me to tell it add the schema.

This is where I got stuck. I can't work out what to use for the first
parameter of WriteXML. The second one is the WriteSchema flag, but
what do I use for the first?

I tried ...

dstData.WriteXml(Response, XmlWriteMode.WriteSchema);

thinking that maybe Response was really a stream, but that didn't
work.

So, anyone know how to do this? I just want the most efficient way of
sending the XML including schema to Response.

TIA for any help


Nov 19 '05 #2
>Use Response.OutputStream :)

Fantastic, thanks ;-)
-Brock
DevelopMentor
http://staff.develop.com/ballen
Hello,
I am trying to write some XML from a DataSet out to the Response
object, but I'm getting somewhat stuck.
I started out with ...
strXmlData = dstData.GetXml();
Response.Write(strXmlData);
which was fine, except it doesn't include the schema. I then
discovered that I should have been using WriteXML instead of GetXML,
as that allows me to tell it add the schema.
This is where I got stuck. I can't work out what to use for the
first
parameter of WriteXML. The second one is the WriteSchema flag, but
what do I use for the first?
I tried ...
dstData.WriteXml(Response, XmlWriteMode.WriteSchema);
thinking that maybe Response was really a stream, but that didn't
work.
So, anyone know how to do this? I just want the most efficient way
of
sending the XML including schema to Response.
TIA for any help



--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #3

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

Similar topics

3
by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
2
by: Ian Griffiths | last post by:
I have been given a schema, instances of which I'm required to be able to consume and generate. I'd like to be able to manipulate these instances as DataSets internally in my application. The...
2
by: Usha Vas | last post by:
Hi, I had posted this question in donet.framework.adonet but thought it might make more sense here, so I apologize for the duplicate post. I have an XML schema with one of the elements (Sig)...
3
by: MR | last post by:
Is there a way to load an XML schema into a dataset from a resource or other object? I am using ReadXmlSchema(filename) and that works fine. However, I have many XSD files that I would rather not...
0
by: M. David Johnson | last post by:
I cannot get my OleDbDataAdapter to update my database table from my local dataset table. The Knowledge Base doesn't seem to help - see item 10 below. I have a Microsoft Access 2000 database...
5
by: Arvind P Rangan | last post by:
Hi, i like to read an existing xml file which has a schema defined to it, and then write or add data to the existing xml file using vb.net/c#. May be this Question has been answered earlier....
13
by: Maxwell2006 | last post by:
Hi, We are having a debate over using DataSet as return value type for web services. The problem is that we don't know whether Java applications can use DataSet
15
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 ...
2
by: rrflore2 | last post by:
Ok. I'm writing and deleting to an xml file using a dataset. I have a function in my codebehind page that binds a listbox to the dataset that performs the writes/deletes. Everything seems to be...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.