Read and Write XML Content into SQL Server

Posted on 2013-08-28
Medium Priority
Last Modified: 2013-09-24
I have an XML file 'D:/Message.XML' with contents as follows

       <Description>Test for Message</Description>

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.
Question by:cimscims
  • 2
LVL 41

Accepted Solution

guru_sami earned 2000 total points
ID: 39446263
- Open the xml file and get the content of xml. Then pass the xml to your storedprocedure.
- Read the xml in your storedprocedure and save the values to the table. Example

Sorry didn't find some better examples.
LVL 10

Expert Comment

by:Monica P
ID: 39448168

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

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


Read XML data and save it in the varaible.

After .,making use of the Insert statement to enter the saved  values in to Database
LVL 10

Expert Comment

by:Monica P
ID: 39448342

Expert Comment

ID: 39519604
thank you

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

619 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question