I have this code:
protected readonly IMsgSetRequest RequestMsgSet = null;
protected IMsgSetResponse ResponseMsgSet = null;
public string GetAllCustomer(bool IsActiveOnly = true)
{
RequestMsgSet.ClearRequests();
ICustomerQuery CustomerQueryRq = RequestMsgSet.AppendCustomerQueryRq();
if (IsActiveOnly)
{
if (CustomerQueryRq != null)
CustomerQueryRq.ORCustomerListQuery.CustomerListFilter.ActiveStatus.SetValue(
ENActiveStatus.asActiveOnly);
}
else {
CustomerQueryRq.ORCustomerListQuery.CustomerListFilter.ActiveStatus.SetValue(ENActiveStatus.asAll);
}
ResponseMsgSet = SessionManager.DoRequests(RequestMsgSet);
return(ResponseMsgSet.ToXMLString());
}
Console.WriteLine(GetAllCustomer());
It returns this:
<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<CustomerQueryRs requestID="0" statusCode="1000" statusSeverity="Error" statusMessage="There has been an internal error when processing the request." />
</QBXMLMsgsRs>
</QBXML>
I suspect that the DoRequests runs out of memory as I have 110,000 customers.
How can I confirm that DoRequests is running out of memory?
How can I rewrite this code to use less memory?