Error saving with SQL Server XML datatype

Posts   
 
    
Posts: 35
Joined: 22-May-2006
# Posted on: 28-Oct-2006 01:11:00   

Hi,

I have a SQL Server 2005 database with a XML datatype. LLBLGen interprets this as a string for some reason. When I load the entity and save I get the following error:

An exception was caught during the execution of an action query: XML parsing: line 1, character 38, unable to switch the encoding. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception."}

Is there something I am doing wrong?

Thanks,

Nate

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 28-Oct-2006 10:05:25   

It's a string because the SqlClient in .net returns it as a string.

At the top of the Xml document you set as the value of the property, you can specify the encoding. Be sure this is the encoding matching the XML in the document. SqlServer will parse the string and if it runs into tokens not matching the encoding set you'll get this error.

Frans Bouma | Lead developer LLBLGen Pro