从asp.net中的一个表或多个表动态生成xml标记 [英] dynamic generation of xml tag from one table or more than one table in asp.net
本文介绍了从asp.net中的一个表或多个表动态生成xml标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,先生请您帮助如何从一个或两个表动态生成xml文件,并且该标签应该是雇员表empname中用户定义的示例,empage应该像雇员详细信息一样放在父标签下,因为雇员详细信息标签中还有一个名为employeeinfo containsg薪资的标签,请参见以下格式
Hi sir pls help how to generate the xml file dynamically from one or two table and the tag should be user defined example from employee table empname , empage should come under parent tag like employee detail in that employee detail tag is having one more tag called employeeinfo containg salary pls see below format
< employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file1.xsd">
<header data></header data>
<employeedetail>
<empname>abc</employeename>
<empage >23</empage>
<employeeinfo>
<empsal> 5000</empsal>
</employeeinfo>
</employeedetail>
推荐答案
您可以在SQL Server中使用FOR XML子句.它非常简单.前往Google
You can use FOR XML clause in SQL Server. Its very simple. Go google
这篇关于从asp.net中的一个表或多个表动态生成xml标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文