Thread: How to convert a database into an xml document? Reply to Thread

Your Username: Click here to log in
Title:
  
Message:
Post Icons
You may choose an icon for your message from the following list:
 

Additional Options

Miscellaneous Options

Topic Review (Newest First)

27th March 2013 02:21 PM
Unregistered
Re: How to convert a database into an xml document?

HOW TO CONVERT DATABASE TABLE INTO XML DOCUMENT FORMAT
2nd February 2011 03:53 PM
simran kaur20389
Re: How to convert a database into an xml document?

================================================== =====
Create Object Of Dataset.
DataSet ds=new DataSet();
Get Data from Database by Method;
string strXML=ds.GetXML();

Hi,
pLEASE FIND this code......
Now Create XML Document.
XmlDocument doc = new XmlDocument();
doc.LoadXml(strXML);

for write XML to XML file.



All d best
ds.WriteXML("MyDs.xml");
2nd February 2011 11:52 AM
sheenu goel
Re: How to convert a database into an xml document?

You can easily use xml convertor, its a software which converts data into xml, and it can be downloaded from internet for free.

Try it and enjoy your data in xml
2nd February 2011 11:47 AM
swarupdey89
Re: How to convert a database into an xml document?

There are some codes you have to learn for doing this..
you can get a brief view of those codes and techniques on below links:

http://www.codeproject.com/KB/cpp/DB2XML.aspx

Do you want to export the records in the tables to XML files? If so, we can use the following methods:
1.The following bcp command is used to export the records in the Department table to an XML file named “Test.XML”:

bcp AdventureWorks2008R2.HumanResources.Department format nul -x –f Test..xml -n –T

Please see:

http://msdn.microsoft.com/en-us/library/ms191516.aspx
2. We can use SSIS to generate an XML file, please see:

http://www.learnitfirst.com/Course/153/Video/1305/Export-an-XML-File-Using-SSIS.aspx

3. Do you use ADO.NET? If so, we can also use the WriteXml and WriteXmlSchema methods to export the records in the table to an XML file. Please see the following C# sample:

using (SqlConnection Conn = new SqlConnection("Data Source=localhost;User Id=test; Password=test; Initial Catalog=AdventureWorks"))

{

DataSet Ds = new DataSet("Sales.Customer");

SqlDataAdapter DBAdapter = new SqlDataAdapter("SELECT TOP 10 CustomerID,AccountNumber FROM Sales.Customer
", Conn);

DBAdapter.Fill(Ds);

Ds.WriteXml(@"D:\Test.XML", XmlWriteMode.WriteSchema);



}

Please see:

http://msdn.microsoft.com/en-us/library/system.data.dataset.writexml.aspx

http://msdn.microsoft.com/en-us/library/system.data.dataset.writexmlschema.aspx

Thanks,
1st February 2011 06:52 PM
baba04051988
Re: How to convert a database into an xml document?

hello friend

for converting database to xml document visit the link given below

http://www.codeproject.com/KB/cpp/DB2XML.aspx

best of luck
27th January 2011 09:59 PM
parirvsmca
How to convert a database into an xml document?

how can we convert a database as xml document and how can we convert a xml document as database?

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
vBulletin Optimisation by vB Optimise.