Read and Write XML Content into SQL Server

I have an XML file 'D:/Message.XML' with contents as follows

<MessageList>
   <Message>
       <Description>Test for Message</Description>
       <User>ABC123</User>
   </Message>
</MessageList>

I have a SQL table 'tblMessages' with
- Id (Identity column)
- Description nvarchar(max)
- User nchar(10)

I have a c# class file which has a function (InsertXMLContent()). I would like to read the XML file and write the content into the SQL table.

Thanks in advance.
cimscimsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

guru_samiCommented:
- Open the xml file and get the content of xml. Then pass the xml to your storedprocedure.
Example.
- Read the xml in your storedprocedure and save the values to the table. Example

Sorry didn't find some better examples.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Monica PSoftware DeveloperCommented:
Hi

Read the XML Data and pass it into the SQL ..

Read XML Data :http://www.dotnetperls.com/xmlreader-vbnet

http://www.simplevb.net/content/read-data-from-an-xml-file-in-vbnet-ID42.aspx

Read XML data and save it in the varaible.

After .,making use of the Insert statement to enter the saved  values in to Database
0
Monica PSoftware DeveloperCommented:
0
VBdotnet2005Commented:
thank you
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.