dataSet.GetXml() doesn#39;t return xml for null or blank columns(dataSet.GetXml() 不为 null 或空白列返回 xml)
问题描述
当我调用 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:dataSet.GetXml() 不为 null 或空白列返回 xml


- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 输入按键事件处理程序 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01