Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have a xmlfile which contain schema of database and data how i can save this data to another database in same DBMS or Different Database in the Different DBMS ( Database conversion/Migration) Using .NET
Posted
Comments
anshudutta 25-Apr-11 3:32am    
Do you want to do this through code?
binson143 1-May-11 3:48am    
Yaa
Sergey Alexandrovich Kryukov 25-Apr-11 3:34am    
"Converting"? Not again! This is some pandemic terminology abuse infected most CodeProject Inquirers. How infected who first?!
--SA

you can try,-
ds.ReadXml("C:\myxmlfile.xml") 


or have a look in this links,-

http://msdn.microsoft.com/en-us/library/Aa325640[^]

http://www.beansoftware.com/ASP.NET-Tutorials/Using-XML.aspx[^]


Hope this can help you.
 
Share this answer
 
v2
C#
using System.Xml;
XmlDocument doc = new XmlDocument();
            doc.Load(@"C:\Path\To_my\xmlfile.xml");
//update doc.SelectNodes("/RssItem/Rss") and node.Attributes["Url"].InnnerText to match your xmlfile structure
            foreach (XmlNode node in doc.SelectNodes("/RssItem/Rss"))
            {
// update the insert into rss (Url) values to match your database
                string txtSQLQuery = "insert into  rss (Url) values ('" +node.Attributes["Url"].InnerText + "')";
                ExecuteQuery(txtSQLQuery);
            }
		}
 
Share this answer
 

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