问题描述
大家好,
在数据集中,某些列为空.我想要输出XMl中的那些列.我正在使用Dataset.getxml()和Loadxml将其转换为xml文档.
如果您有解决此问题的方法,请提出建议..
示例:
考虑我的数据集如下:
< firstname> SUGATO</firstname>
< middlename></middlename>
< lastname> PAL</lastname>
如果我使用dataset.getxml,那么我会得到
< firstname> SUGATO</firstname>
< lastname> PAL</lastname>
输出的xml将丢失< middlename></middlename>节点.
我想要这个< middlename>也在我的输出xml中
感谢您的帮助.
Hello Everybody,
In the Dataset,some columns are empty.I want those columns in the output XMl.I am using Dataset.getxml() and Loadxml to convert it in to xml document.
Please suggest me if you have any solution of this problem..
Example:
Consider my dataset is as below:
<firstname>SUGATO</firstname>
<middlename></middlename>
<lastname>PAL</lastname>
If i use dataset.getxml then i will get
<firstname>SUGATO</firstname>
<lastname>PAL</lastname>
the output xml will miss <middlename></middlename> node.
I want this <middlename> also in my output xml
Appreciate your Help.
推荐答案
Dataset.GetXML()
返回字符串.您可以将类似这样的条件应用于您的病情.
returns string. You can apply to your condition something like this.
if (ds.GetXml() != string.Empty) {
//do your code here...
}
else {
//ignore
}
这篇关于我如何使用Dataset.GetXml命令将数据集的空列转换为XML文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!