Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted
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.
Here's what I'm up to.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...