在Designer中的DataSet.xsd中包含Collection Type或ComplexType [英] Including Collection Type or ComplexType in DataSet.xsd In Designer

查看:62
本文介绍了在Designer中的DataSet.xsd中包含Collection Type或ComplexType的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在使用DataSet.xsd将Xml文件加载到DataSet,修改并写回Xml文件。

我用过了设计师添加DataSet.xsd(我没有添加Xml Schema)。

我有一个DataTable如下:

产品

ProductId

ProductName

ItemTypeCollection

我希望将Xml生成为:

<的产品与GT;

<产品编号大于0< /产品编号>

<产品名称>名1< /产品名称>

< ItemTypeCollection>

< font color ="#cc0000">< ItemType> 1< / ItemType>

< ItemType> ; 2< / ItemType>

< ItemType> 3< /的ItemType>

< ItemType> 4< / ItemType>

< / ItemTypeCollection>

< / 产品>

请帮忙!

解决方案

我认为您正在寻找的内容包含在以下文档中,该文档描述了如何从数据生成XML文档中的嵌套数据关系集。

http://msdn.microsoft.com/en -us / library / 7sfkwf9s(VS.71).aspx

您可以在上面的节点中找到有关使用xml和数据集的描述,这些描述也很有用:

http://msdn.microsoft.com/en-us/library/84sxtbxh(VS .71).aspx

希望这有助于

Fred


Hello,

I'm using DataSet.xsd for loading an Xml file to DataSet, modifying and writing back to Xml file.

I've used the designer to add DataSet.xsd (I've not added Xml Schema).

I've a DataTable as follows:

Product

ProductId

ProductName

ItemTypeCollection

I want Xml to be generated as:

<Product>

<ProductId>0</ProductId>

<ProductName>Name1</ProductName>

<ItemTypeCollection>

<ItemType>1</ItemType>

<ItemType>2</ItemType>

<ItemType>3</ItemType>

<ItemType>4</ItemType>

</ItemTypeCollection>

</Product>

Please Help!

解决方案

I think what you are looking for is covered by the following document, which describes how to generate nested data relations in XML documents from data sets.

http://msdn.microsoft.com/en-us/library/7sfkwf9s(VS.71).aspx

You may find the descriptions on working with xml and datasets in the node right above that useful as well:

http://msdn.microsoft.com/en-us/library/84sxtbxh(VS.71).aspx

Hope this helps

Fred


这篇关于在Designer中的DataSet.xsd中包含Collection Type或ComplexType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆