开发者

Dataset XML question

开发者 https://www.devze.com 2023-04-06 05:59 出处:网络
In VB.NET when I use the WriteXML of DataSet, can I customize it? That is to say; I want to make a structure like this:

In VB.NET when I use the WriteXML of DataSet, can I customize it? That is to say;

I want to make a structure like this:

<products&开发者_JAVA技巧gt;
<product id="" title="">
<product id="" title="">
<product id="" title="">
</products>

How can I do? Thanks..


you can use DataSet.GetXml Method and ColumnMapping accordingly

Dim column As DataColumn
For Each column In ds.Tables.Item(0).Columns
    column.ColumnMapping = MappingType.Attribute
Next
Dim xml As String = ds.GetXml()
0

精彩评论

暂无评论...
验证码 换一张
取 消