XML File - split up and add to SQL table

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi

I have an XML file with 50 fields,
I want to split up these fields and put them in the corresponding fields in
the SQL table

whats the most efficent way to do this? and how do i do it

...also, i'd like to get threads of problems with solutions (like the NG's)
sent to my inbox, anyone know of any?

Thanks in advance
Mark
 
Well for Starters
if you have one to one field mapping from xml into sql then use openxml...
(sql server xml)...
read the document using XMLStream and send it straight off to database for
it to handle the problem

if not... read look up System.XML namespace.. you have too many different
class that give you all sorts of features...
Again you need to read the xml to decide what needs to be sent to your
inbox..
use cdonts or use smtpmail...

Regards,

HD
 
Mark said:
I have an XML file with 50 fields,
I want to split up these fields and put them in the corresponding
fields in the SQL table
Whats the most efficent way to do this? and how do i do it

Mark,
Try using the "System.Xml.XmlDataDocument" class. You can read in
an XML file, then sync it up with a DataSet. You can then create and
use a SqlDataAdapter to insert the data into a SQL database.

For more information, see:
http://msdn.microsoft.com/library/e...onsynchronizingdatasetwithxmldatadocument.asp

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com
 
Thanks both

The field mapping is one to one, i've tried looking up
help on OpenXml but cant find it, cant you give me a
little bit more of a clue so I can go looking
Thanks
Mark
 
Back
Top