locked
Saving XML File contents to table columns!! RRS feed

  • Question

  •  Hi all,

    I have a XML File which I want to save to the sql server. The problem is how do i save or you can say map the nodes name with that of the table column name. I don't want to save the file with the datatype as XML. I want to read the XML file traverse through the nodes and save the data in the table.

    Please HELP!!!


    Thanks.
    prs
    Monday, December 22, 2008 2:31 PM

Answers

  • There are a number of ways that you can do this.

    The first option would be to load the XML into a DataSet, then save the records from the dataset.

    The second would be to use an XML Reader to loop through the XML document and save the results.
    Mitchel Sellers, MCITP, MCPD, MCTS - http://www.mitchelsellers.com
    • Proposed as answer by Guo Surfer Thursday, December 25, 2008 8:52 AM
    • Marked as answer by Guo Surfer Friday, December 26, 2008 7:27 AM
    Monday, December 22, 2008 6:51 PM

All replies

  • There are a number of ways that you can do this.

    The first option would be to load the XML into a DataSet, then save the records from the dataset.

    The second would be to use an XML Reader to loop through the XML document and save the results.
    Mitchel Sellers, MCITP, MCPD, MCTS - http://www.mitchelsellers.com
    • Proposed as answer by Guo Surfer Thursday, December 25, 2008 8:52 AM
    • Marked as answer by Guo Surfer Friday, December 26, 2008 7:27 AM
    Monday, December 22, 2008 6:51 PM
  • Can't I use OpenXML.. If yes.....HOW?
    prs
    Monday, December 29, 2008 7:44 AM