jdelator
jdelator

Reputation: 4251

How to store xml files in an xml column using linq to sql?

I have xml files I want to read in and store in the database. Linq to sql requires the data to be sent in using an xelement, but if I send in the data this

new XElement("build", BuildNode.InnerXml)

I end up with data looking like this in the database lt;..gt;.. It converts the brackets into lt; and gt; which then makes the data useless from a xml standpoint.

Any ideas on how to get the xml data inside the xml column?

Upvotes: 2

Views: 1206

Answers (1)

Paul Prewett
Paul Prewett

Reputation: 2033

Looks like you should use XElement.Parse(BuildNode.InnerXml) instead of just passing the raw property in.

RE: http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/413654f3-dc2d-4b96-8a7e-bde69da05866/

Upvotes: 2

Related Questions