#1
27th January 2011, 09:59 PM
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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, |
#5
2nd February 2011, 03:53 PM
|
|||
|
|||
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"); |
|
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 |
|