I have a SQL Server table which has a column of SQL data type text. This column contains rtf formatted text.
I read the table as a DataTable.
I'm trying to get the column value as a string and append it with additional text.
string rtfContent = SourceRow["TEXT"].ToString();
rtfContent += "more text";
But somehow, the string does not change. The value more text is not being added.
I tried all possible types of concatenations (that I am aware of):
string str = string.Concat(rtfContent, "more text");
str = rtfContent + "more text";
str = $"{rtfContent} more text";
str = string.Format("{0}{1}", rtfContent, "more text");
I can add text before the actual rtf string, e.g.:
string str = "more text" + rtfContent;
But in my case I need both options.
This is my rtfContent:
{\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fnil\fcharset0 Arial Unicode MS;}}
\viewkind4\uc1\pard\tx568\tx1136\tx1704\tx2272\tx2840\tx3408\tx3976\tx4544\tx5112\tx5680\f0\fs20 Produktbeschreibung:\par
\b Fahrzeugleitung nach DIN 72551\par
\b0 Typ FLRY\par
Isolationsreduziert\par
2,5 mm\'b2\par
5, 25, 100 m Ring\par
rot\par
Hersteller: FREI\par
Verpackungsgewicht: 0.649kg\par
RoHS: konform\par
\par
}
In Visual Studio while debugging:
//rtfContent: "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1031{\\fonttbl{\\f0\\fnil\\fcharset0 Arial Unicode MS;}}\r\n\\viewkind4\\uc1\\pard\\tx568\\tx1136\\tx1704\\tx2272\\tx2840\\tx3408\\tx3976\\tx4544\\tx5112\\tx5680\\f0\\fs20 Produktbeschreibung:\\par\r\n\\b Fahrzeugleitung nach DIN 72551\\par\r\n\\b0 Typ FLRY\\par\r\nIsolationsreduziert\\par\r\n2,5 mm\\'b2\\par\r\n5, 25, 100 m Ring\\par\r\nrot\\par\r\nHersteller: FREI\\par\r\nVerpackungsgewicht: 0.649kg\\par\r\nRoHS: konform\\par\r\n\\par\r\n}\r\n\0"
Does anyone have an idea why this is not working as expected? Thanks.