473,466 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

writing dataset to xml problem

Hi

I have a web method that returns a string (which has an xml format).
I get a dataset and I need to convert the table in the dataset to xml and
then to send it as a string to the client. How can I do this?
Thanks
Nov 16 '05 #1
3 1282
R.A.,

You can call the WriteXml method on the DataSet, passing a new instance
of a StringWriter. Once you have that, call that, you can call the ToString
method on the StringWriter class, and it should give you the string.

However, I was under the impression that if you returned just a dataset
from the web method, it would handle the formatting of that into XML.

Have you tried just returning the DataSet from the web method?

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"R.A." <te**@hotmail.com> wrote in message
news:O7****************@TK2MSFTNGP11.phx.gbl...
Hi

I have a web method that returns a string (which has an xml format).
I get a dataset and I need to convert the table in the dataset to xml and
then to send it as a string to the client. How can I do this?
Thanks

Nov 16 '05 #2
If I return Dataset wouldn't that force the web service consumer to use
Dataset? I prefer just to send back an xml.
Thanks

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:OW**************@tk2msftngp13.phx.gbl...
R.A.,

You can call the WriteXml method on the DataSet, passing a new instance of a StringWriter. Once you have that, call that, you can call the ToString method on the StringWriter class, and it should give you the string.

However, I was under the impression that if you returned just a dataset from the web method, it would handle the formatting of that into XML.

Have you tried just returning the DataSet from the web method?

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"R.A." <te**@hotmail.com> wrote in message
news:O7****************@TK2MSFTNGP11.phx.gbl...
Hi

I have a web method that returns a string (which has an xml format).
I get a dataset and I need to convert the table in the dataset to xml and then to send it as a string to the client. How can I do this?
Thanks


Nov 16 '05 #3
R.A.,

It wouldn't force the web service consumer to use anything. From the
point of the web service consumer, they are getting XML. Now if you are
using a .NET proxy for it, then yes, it will use a DataSet, which you can
easily get the XML from.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"R.A." <te**@hotmail.com> wrote in message
news:uR**************@TK2MSFTNGP10.phx.gbl...
If I return Dataset wouldn't that force the web service consumer to use
Dataset? I prefer just to send back an xml.
Thanks

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in
message news:OW**************@tk2msftngp13.phx.gbl...
R.A.,

You can call the WriteXml method on the DataSet, passing a new

instance
of a StringWriter. Once you have that, call that, you can call the

ToString
method on the StringWriter class, and it should give you the string.

However, I was under the impression that if you returned just a

dataset
from the web method, it would handle the formatting of that into XML.

Have you tried just returning the DataSet from the web method?

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"R.A." <te**@hotmail.com> wrote in message
news:O7****************@TK2MSFTNGP11.phx.gbl...
> Hi
>
> I have a web method that returns a string (which has an xml format).
> I get a dataset and I need to convert the table in the dataset to xml and > then to send it as a string to the client. How can I do this?
>
>
> Thanks
>
>



Nov 16 '05 #4

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

Similar topics

2
by: Kelly G. | last post by:
Hi all, I have a small problem in writing XML file from VB.net. I am trying to write the XML file using dataset. I am able to write the XML in sequential way(one node after other). I can write...
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...
6
by: dast | last post by:
Hello, I’m having trouble writing the contents of a dataset to a csv file. I have made a solution that loops through the rows in the dataset, but it’s too slow. There must be a faster and...
8
by: Paul | last post by:
I have an application that I am tryign to modify, I never wrote the original so need help with my modifications. Currently the app reads and writes to an Access database with one table 'pupils'...
3
by: Eric | last post by:
Help! I created a XML schema with a Visual Studio tools. I'm filling a dataset with a DataAdapter. Before I use the "WriteXml" method to write the data to a xml file, I want to map the XSD file I...
5
by: UJ | last post by:
I have a system that has five programs that all communicate with each other via Message Queues. Works well. One program is a watchdog that will make sure the others are up and going. Currently I...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.