Click here to Skip to main content
15,921,028 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,
My database in sqlserver 2008 i want to convert into xml file can u guide or send any snippets
Posted
Comments
I.explore.code 17-Aug-12 9:26am    
have u tried anything yourself first? Show us your efforts i.e. code!
[no name] 17-Aug-12 9:28am    
Read this first: http://www.codeproject.com/Articles/64628/Code-Project-Quick-Answers-FAQ

You're question is a bit unclear but if you want to work with XML using the SQL Server, I'd suggest going through these concepts: Implementing XML in SQL Server[^]

If you simply want to ha the results of a query as XML, have a look at: FOR XML[^]
 
Share this answer
 
This[^] is how google works. You can also just write code that shapes the data in to XML manually if you prefer.
 
Share this answer
 
C#
DataTable dt = new DataTable();
            SqlDataAdapter ad = new SqlDataAdapter(selectCommandText,Connection);
            ad.Fill(dt);
            dt.WriteXml("D:\myfile.xml");
 
Share this answer
 
v3

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