473,405 Members | 2,334 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,405 software developers and data experts.

problem with DataSet.GetXml() method

Hi guys!

i've filled the DatSet object and was trying to get xml data from it. i
used GetXml() method for that.
it worked fine when all columns of the datatable has data. it generates
perfectly fine xml but when if one column in datatable has no
data(null), the method doesnt generates xml for that column.

for example :

i've table in sql server database called temp1 which has 4 columns but
sometimes only 1,3 column has data and 2,4 column doesnt has data.
which looks like this

col1 col2 col3 col4
1 NULL 1 NULL

when i fetch data from the database into the dataset and try to get xml
of that data, it looks like this:

<NewDataSet>
<Temp1>
<col1>1</col1>
<col3>1</col3>
</Temp1>
</NewDataSet>

another thing that is happening in process is, after fetching the data
into the dataset i'm extracting the datatable from the dataset and
insert into another dataset and then i call the GetXml() method of the
dataset.

can anyone tell me what i'm missing or is there any other way to do
this?

thanks
Lucky

Nov 17 '06 #1
1 2748
This is correct. You will then have to examine the XML for the existence of
a tag before attempting to extract the data in that tag.
"lucky" <tu************@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi guys!

i've filled the DatSet object and was trying to get xml data from it. i
used GetXml() method for that.
it worked fine when all columns of the datatable has data. it generates
perfectly fine xml but when if one column in datatable has no
data(null), the method doesnt generates xml for that column.

for example :

i've table in sql server database called temp1 which has 4 columns but
sometimes only 1,3 column has data and 2,4 column doesnt has data.
which looks like this

col1 col2 col3 col4
1 NULL 1 NULL

when i fetch data from the database into the dataset and try to get xml
of that data, it looks like this:

<NewDataSet>
<Temp1>
<col1>1</col1>
<col3>1</col3>
</Temp1>
</NewDataSet>

another thing that is happening in process is, after fetching the data
into the dataset i'm extracting the datatable from the dataset and
insert into another dataset and then i call the GetXml() method of the
dataset.

can anyone tell me what i'm missing or is there any other way to do
this?

thanks
Lucky

Nov 17 '06 #2

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

Similar topics

0
by: softengine | last post by:
I have a dataset with multiple tables I need exported to Excel. I can get it into Excel into one worksheet however I want there to be one worksheet for each datatable in the dataset. If I dump my...
1
by: Mark | last post by:
I have a basic question about xml encoding and predefined characters in xml. I know that characters such as "<" get encoded to &lt; My question is when does this actually happen? I'm using the...
2
by: Rajesh AVRS | last post by:
Hi guys I have a requirement where I needed to extract the DataSet contents as XML. After filling the dataset, I am calling GetXml() and is working fine. However, one of the column which I...
1
by: Kashyap | last post by:
Hi I am trying to convert a dataset to xml using dataset.getxml. But this xml doesn't contain elements for null columns that are present in the dataset. How can we explicitly control this...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
1
by: Elad | last post by:
hi, I'm sorry if this isn't the right group, I just didnt know which category to place this question in. Anyway, I have 2 problems: I got a web service which connects to a DB and puts the data in...
2
by: Ganesh Muthuvelu | last post by:
Hello, I have a schema that contains two "choice" elements, say "F1" and "F2" - meaning either F1 or F2 can be present but not both. I loaded this schema into a dataset, which created two columns...
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
1
by: lucky | last post by:
Hi guys! i've filled the DatSet object and was trying to get xml data from it. i used GetXml() method for that. it worked fine when all columns of the datatable has data. it generates perfectly...
3
by: Greg Collins [Microsoft MVP] | last post by:
I have a SQL2005 XML column I load into a DataSet. I then bind to a DataGrid. If I set an asp:Literal text value to the DataSet.GetXml() when I first load it into the DataSet, it displays...
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
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...
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
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
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.