問題描述
當我調用 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的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!