﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » How to save a Xml-File on SQL-Server</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 01 Sep 2026 07:59:19 GMT</lastBuildDate><ttl>20</ttl><item><title>How to save a Xml-File on SQL-Server</title><link>http://forum.strataframe.net/FindPost22356.aspx</link><description>Hi,&lt;br&gt;
&lt;br&gt;
I have follwing probelm.&lt;br&gt;
&lt;br&gt;
I have a table on sqlserver with a field of type XML&lt;br&gt;
&lt;br&gt;
in BO i changed Datatype of this field to System.Data.SqlTypes.SqlXml&lt;br&gt;
&lt;br&gt;
this is code  for saveing XML on SQL-Server :&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
&lt;br&gt;
        If File.Exists(LcFileName) Then&lt;br&gt;
 &lt;br&gt;
           Dim loXMLDocument As XmlDocument = New XmlDocument&lt;br&gt;
           loXML&amp;#100;ocument.Load(LcFileName)&lt;br&gt;
           loXML = New SqlXml(New XmlTextReader(loXML&amp;#100;ocument.InnerXml, XmlNodeType.Document, Nothing))&lt;br&gt;
&lt;br&gt;
            GridConfigBo1.layoutxml = loXML&lt;br&gt;
&lt;br&gt;
            GridConfigBo1.Save()&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
        End If&lt;br&gt;
 &lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
When Record not exist on SQL-Server then Record will be saved.&lt;br&gt;
&lt;br&gt;
Next time when i try to update XML-Field i got error message. (Translated error message)&lt;br&gt;
&lt;br&gt;
[i]The XML Datatyp can be only  compared or sorted with the is null operator.[/i]&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
what did i wrong ???&lt;br&gt;
&lt;br&gt;
Thanks &lt;br&gt;
&lt;br&gt;
Rainer&lt;br&gt;</description><pubDate>Sat, 14 Mar 2009 11:56:03 GMT</pubDate><dc:creator>Rainer Kempf, RK</dc:creator></item><item><title>RE: How to save a Xml-File on SQL-Server</title><link>http://forum.strataframe.net/FindPost22365.aspx</link><description>This will be impossible to tell without a sample and the actual XML data.&amp;nbsp; When using an XML data type on SQL Server, you MUST have the xml properly formatted and provide a schema otherwise it will fail.&amp;nbsp; The XML data type is pretty cool if you get it working as you can query within the XML string...however, this is not a forgiving data type.&amp;nbsp; Why are you using the Xml data type instead of a VarChar or NVarChar fiield?</description><pubDate>Sat, 14 Mar 2009 11:56:03 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>