473,468 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Dataset.WriteXml how to skip DBNull elements when writing to XML?

2 New Member
Hello

I have the opposite problem as
http://www.thescripts.com/forum/thread176792.html

When I'm writng XML files with
report.WriteXml(scriptName +".xml",XmlWriteMode.WriteSchema);

The write method writes out post which are DBNull to the xml document. Then when I read the document using
report.ReadXml(script, XmlReadMode.ReadSchema);
I retrieve a dataset where values which should be null are EmptyString.

Are there any why I can write to xml and skip writing DBNull elements?




(Yes, Default value for elements that should be DBNull is DBNull)

Regards Leonard
Nov 30 '07 #1
2 2420
Airslash
221 New Member
Hello

I have the opposite problem as
http://www.thescripts.com/forum/thread176792.html

When I'm writng XML files with
report.WriteXml(scriptName +".xml",XmlWriteMode.WriteSchema);

The write method writes out post which are DBNull to the xml document. Then when I read the document using
report.ReadXml(script, XmlReadMode.ReadSchema);
I retrieve a dataset where values which should be null are EmptyString.

Are there any why I can write to xml and skip writing DBNull elements?




(Yes, Default value for elements that should be DBNull is DBNull)

Regards Leonard
eum, check the value before writing, and only write if it has the correct value ?
Nov 30 '07 #2
leonards
2 New Member
That should not be necessary, there should be a way to not print out DBNull elements.
Nov 30 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

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...
1
by: Wil | last post by:
I'm very new to developing in .NET and even newer to XML. The past few days have been pretty frustrating for me because I'm trying to perform a transform on data in a dataset and it's not working....
1
by: Rahul Agarwal | last post by:
Hi I am trying to write data back to the client using dataset.WriteXML and I have set the Thread.CurrentThread.CurrentCulture to "no" (norwegian) just before writing the data using WriteXML....
2
by: Andreas Palm | last post by:
I have a dataset that has DBNull in certain columns, now when I write out this one to XML, I only get the columns as elements that do have data in it. However I do need also the empty colums as...
3
by: Joe98765 | last post by:
I have data coming from SQL Server and need to write out some XML. I have a schema(xsd) for this XML file. Right now I am bringing in the DataSet and writing out the elements and attributes myself...
0
by: Kermit | last post by:
I am re-writing a vb script that queries an SQL server and then uses the recordset to generate an xml file. The xml file has a row-set schema with row as the element and the columns as attributes:...
0
by: Michel Müller | last post by:
I am re-writing a vb script that queries an SQL server and then uses the recordset to generate an xml file. The xml file has a row-set schema with row as the element and the columns as attributes:...
9
by: PeterWellington | last post by:
I have a column in a data table that stores enum values and assigns a default value: Dim dc As New DataColumn("TestEnumField", GetType(DayOfWeek)) dc.DefaultValue = DayOfWeek.Thursday When I...
2
by: MaLec | last post by:
I’d like to use the DataSet as the container for the XML files conforming to some schema. The problem is, that the operation of reading the XML file into the DataSet having its schema and then...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
1
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: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.