supafly Posted May 25, 2005 Posted May 25, 2005 Hi Pulling data from database through sqldataadapter to a dataset, and then write it to a file was really easy, so I thought that it would be equal easy to reverse it, but I can't quite figure it out. I can load the xml document into a DataSet, now I just want to push the data onward by a DataAdapter to a Mssql database. Xml nodes will have same names as the database tables and fields <PARENT> <PARENTID>99</PARENTID> <CHILD> <GRANDCHILD1>14</GRANDCHILD1> <GRANDCHILD2>991</GRANDCHILD2> <GRANDCHILD3>99</GRANDCHILD3> <GRANDCHILD4>99</GRANDCHILD4> ... </CHILD> <CHILD> ... </CHILD> </PARENT> Any hints on this one? plz...would prefer c# example if any1 have suggestions. Quote
Machaira Posted May 25, 2005 Posted May 25, 2005 Try creating a datatable from the MSSQL table where you're going to store the data, create a database from the XML, and add the rows in the XML datatable to the MSSQL datatable (create a row from the MSSQL datatable and copy the items from a row in the XML datatable to this new row, then add the new row to the MSSQL datatable). I don't believe you can do it as simply as you're thinking. Quote Here's what I'm up to.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.