Tom Squires
Tom Squires

Reputation: 9286

Using XML datatype with LINQ to SQL

I want to store an xml file in my database using the XML datatype. Currently the property of the entity is XElement. I set this to a Xelement and debugging i can see that its set correctly on the entity however it dosent save when I submit changes.

Is what I want to do possible? Should i change the default mapping?

Upvotes: 2

Views: 3306

Answers (1)

rostam
rostam

Reputation: 729

See http://conficient.wordpress.com/2008/08/11/linq-to-sql-faq-xml-columns-in-sql/

and Linq-to-SQL With XML Database Fields -- Why does this work?

You need to new up a new XElement with the changes for linq to sql to update the field.

Upvotes: 2

Related Questions