469,926 Members | 2,496 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

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 1448
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rajesh AVRS | last post: by
1 post views Thread by Kashyap | last post: by
22 posts views Thread by Arne | last post: by
2 posts views Thread by Ganesh Muthuvelu | last post: by
13 posts views Thread by Maxwell2006 | last post: by
1 post views Thread by lucky | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.