Insert into XML column

M

Mervin

Can anyone provide sample code for simply inserting the xml from an XDocument
into a XML column in SQL Server?

Thanks in advance.
 
M

Mervin

I discovered the answer. If using a SqlDataSource on a FormView, within the
..aspx page change the Parameter type from Object to String. Then, set the
value of the XML column to the string of the XDocument value:

XDocument responseXML = XDocument.Load(tr);
e.Values["Response_Xml"] = responseXML.ToString();

Mervin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top