I am writing an application in C# that uses forms. This is my first app written in C# so I am very much a beginner.
This is the problematic code
if (tabControl1.InvokeRequired)
{
stringDelegateC sdc = new stringDelegateC(manageCode);
this.Invoke(sdc, new object[] { text });
}
else
...
The variable text is always a string in the format: “PM” followed by a number. It works fine most of the time but when text is “PM11020” I get System.Xml.XmlException thrown with the message “An error occurred while parsing EntityName. Line 5, position 25.”. The exception is thrown by this.Invoke(sdc, new object[] { text });
If text is “PM11120”, it works fine.
I am very confused by this, I don’t know what XML has to do with anything.
That XML exception is probably thrown by the
manageCodemethod and has nothing related toControl.Invoke.