By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,099 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

problem with DataSet.GetXml() method

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.