#1  
27th January 2011, 09:59 PM
parirvsmca
Junior Member
 
Join Date: Jan 2011
Posts: 1

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?




  #2  
1st February 2011, 06:52 PM
baba04051988
Junior Member
 
Join Date: Feb 2011
Posts: 23
Default 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
  #3  
2nd February 2011, 11:47 AM
swarupdey89
Junior Member
 
Join Date: Feb 2010
Location: midnapore,west bengal,india
Posts: 177
Default 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,
  #4  
2nd February 2011, 11:52 AM
sheenu goel
Junior Member
 
Join Date: Feb 2011
Posts: 13
Default 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
Reply With Quote
  #5  
2nd February 2011, 03:53 PM
simran kaur20389
Senior Member
 
Join Date: Feb 2011
Location: Delhi
Posts: 275
Default 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");
Reply With Quote
  #6  
27th March 2013, 02:21 PM
Unregistered
Guest
 
Posts: n/a
Default Re: How to convert a database into an xml document?

HOW TO CONVERT DATABASE TABLE INTO XML DOCUMENT FORMAT
Reply With Quote
Do you have any question? or have anything to say?



Related Topics:

Thread Replies Last Post
About sql database and demand for this database in these times? 14 7th April 2023 05:05 PM
Is there any chance to convert CPT from objective to descriptive? 5 19th January 2015 02:46 PM



Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
vBulletin Optimisation by vB Optimise.
Please also check: