• 0

C# Create XML, has extra slash


Question

Hello gang,

 

I am creating an xml document from data from a database.  However when I write them as an attribute it gets an extra slash

<Trend Ident=\"1\" Info=\"Test1\" />

The database has only "Test1"

 

The code is as follows:

                while (drGet.Read())
                {
                    XmlElement Trend = xmlTrending.CreateElement("Trend");
                    Trend.SetAttribute("Ident", drGet.GetInt32(0).ToString());
                    Trend.SetAttribute("Info", drGet.GetString(1));
                    Trends.AppendChild(Trend);
                }

Thanks

Link to comment
https://www.neowin.net/forum/topic/1219187-c-create-xml-has-extra-slash/
Share on other sites

6 answers to this question

Recommended Posts

This topic is now closed to further replies.