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


基础教程推荐
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01