Hi there,
I'm trying to store a XML file to SQL SERVER 2008 database. but if my file has the declaration with na 'encoding' property, the Visual Studio returns to me an error.
"XML Analysis: line 1, char 38, is not possible to alternate encoding."
I've tried some alternative ways then i finally succeed to save a XML file without encoding tag.
I'm Tryin this:
...code
_Command.Parameters.Add(NewSqlParameter("@XML",SqlDbType.Xml)With{.Value = _XML.InnerXml})
_Command.ExecuteNonQuery()
...code
If My XML File declaration is
<?xml version="1.0" encoding="UTF-8"?> <--- Returns the Error
<?xml version="1.0"?> <---- Succeed
My Question is how can I remove this 'enconding' part of declaration and if it's possible do it workign with the XMLDocument Object.
PS. I'm Using VB.NET, Visual Studio 2010, SQLServer 2008 R2 and has a field in my DB with XML type.