title: An error occurred while parsing EntityName. Line1, position 844
body: <p>I have got the following exception from the below code block.</p>
  
  <p><strong>An error occurred while parsing EntityName. Line1, position 844.</strong></p>
  
  <p>I was trying to parse s set of data retrieved from table to a data set.</p>
  
  <pre><code>public DataSet BindMasterData(string xml)
          {
              DataSet ds = null;
              try
              {
                  ds = new DataSet();
                  TextReader txtReader = new StringReader(xml);
                  XmlReader reader = new XmlTextReader(txtReader);
                  ds.ReadXml(reader);
              }
              catch (Exception ex)
              {
                  return new DataSet();
              }
              return ds;
          }
  </code></pre>
  
  <p>I have figured out the reason for the exception, but I couldn't solve it. In this particular situation, the string(which is retrieved from DB) contains a special character (&amp;). That causes exception. How I can solve it. Any help on this would be great.</p>