Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

XML
< 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>
Posted

1 solution

You can use FOR XML clause in SQL Server. Its very simple. Go google
 
Share this answer
 
Comments
mamathakalyan 12-Jul-10 2:15am    
thanks this is very useful but in asp.net how to implement it

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900