当我调用 dataSet.GetXml() 时,我没有为具有空值或空白值的列返回任何 xml.有没有一种简单有效的方法来解决这个问题?下面是问题的一个例子.请注意第二个结果部分中缺少 a2 的情况.
When I call dataSet.GetXml() I don't get any xml returned for columns with null or blank values. Is there a simple, efficient way to get around this? An example of the problem below. Notice how a2 is missing from the second results section.
<results>
<a1>test1</a1>
<a2>test2</a2>
<a3>test3</a3>
</results>
<results>
<a1>Atest1</a1>
<a3>Atest3</a3>
</results>
此 Microsoft 知识库文章中详细介绍了该问题:http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q317961.有关更多详细信息,请参阅上一个 SO 问题:DataSet.GetXml 不返回空结果.
The problem is detailed in this Microsoft KB article: http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q317961. See this previous SO question for more detail: DataSet.GetXml not returning null results.
我认为您的直接问题没有很好的解决方案.不过,考虑到上下文,可能还有另一种解决问题的方法.
I don't think there is a good solution to your direct question. Given context, there may be another way to approach the problem though.
这篇关于dataSet.GetXml() 不为 null 或空白列返回 xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!