The maximum nametable character count quota (16384) has been exceeded while reading XML data. The nametable is a data structure used to store strings encountered during XML processing - long XML documents with non-repeating element names, attribute names and attribute values may trigger this quota. This quota may be increased by changing the MaxNameTableCharCount property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 1298.
ublic List<AccountEntityModels> RetriveRecords()
{
using (OrganizationService service = new OrganizationService("MyConnectionString"))
{
QueryExpression query = new QueryExpression
{
EntityName = "accounts",
ColumnSet = new ColumnSet("accountid", "name")
};
List<AccountEntityModels> info = new List<AccountEntityModels>();
EntityCollection accountRecord = service.RetrieveMultiple(query);
if (accountRecord != null && accountRecord.Entities.Count > 0)
{
AccountEntityModels accountModel;
for (int i = 0; i < accountRecord.Entities.Count; i++)
{
accountModel = new AccountEntityModels();
if (accountRecord[i].Contains("accountid") && accountRecord[i]["accountid"] != null)
accountModel.AccountID = (Guid)accountRecord[i]["accountid"];
if (accountRecord[i].Contains("name") && accountRecord[i]["name"] != null)
accountModel.AccountName = accountRecord[i]["name"].ToString();
info.Add(accountModel);
}
}
return info;
}