xmltextwriter

INSERT Xml into SQL Server 2008 database

Hello I'm trying to insert some XML data into a table on SQL Server 2008. However I keep getting thrown this error; XML parsing: line 1, character 39, unable to switch the encoding The database column filemeta uses the XML datatype, and I've switch the encoding to UTF-16 which I believe is necessary for adding XML data. INSERT IN...

How do I display a Registered Trademark symbol (®) using VB.NET?

I have taken over support of an application at the company I work for. All of a sudden, the customer wants to be able to enter a registered trademark in a name field. The symbol, using ALT+0174, is being saved correctly, but the app is not encoding it properly. Essentially this is what I'm doing: Private Sub btnSave_Click(ByVal s...

Save XML like XmlTextWriter but with DOM

When I build a XML in C# using XmlDocument, and I want to save to XML to file, including the encoding information, I use XmlTextWriter, as below: using (StringWriter swr = new StringWriter()) { using (XmlTextWriter xtw = new XmlTextWriter(swr)) { xmlDoc.WriteTo(xtw); return swr.ToString();...