Quickbooks 执行查询时出错。请检查堆栈跟踪以了解更多详细信息

Quickbooks 执行查询时出错。请检查堆栈跟踪以了解更多详细信息,quickbooks,intuit-partner-platform,Quickbooks,Intuit Partner Platform,我试图在qbo中查询一个名为“例如(Joe's Shop)”的客户,并得到上述错误 这是代码 IEnumerable<Customer> customers = customerQueryService.Where(c => c.DisplayName =="Joe's Shop"); if (customers.Count()!=0 ) { customer = customers.First();

我试图在qbo中查询一个名为“例如(Joe's Shop)”的客户,并得到上述错误

这是代码

        IEnumerable<Customer> customers = customerQueryService.Where(c => c.DisplayName =="Joe's Shop");
        if (customers.Count()!=0 )
        {
            customer = customers.First();
        }

        return customer;
IEnumerable customers=customerQueryService.Where(c=>c.DisplayName==“Joe's Shop”);
如果(customers.Count()!=0)
{
customer=customers.First();
}
退货客户;

请使用反斜杠转义单引号

“乔的商店”

感谢使用Intuit.Ipp.Core; 使用Intuit.Ipp.Data; 使用Intuit.Ipp.LinqExtender; 使用Intuit.Ipp.QueryFilter; 使用制度; 使用System.Collections.Generic; 使用System.Linq; 使用系统文本; 静态类抽样调用 { 公共静态客户查询CustomerByDisplayName(ServiceContext上下文,字符串displayName){ displayName=displayName.Replace(“'”,“\\'”);//转义特殊字符 QueryService customerQueryService=新的QueryService(上下文); 返回customerQueryService.Where(m=>m.DisplayName==DisplayName).FirstOrDefault(); } }
using Intuit.Ipp.Core;
using Intuit.Ipp.Data;
using Intuit.Ipp.LinqExtender;
using Intuit.Ipp.QueryFilter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

static class SampleCalls
{
public static Customer QueryCustomerByDisplayName(ServiceContext context, string displayName) {
    displayName = displayName.Replace("'", "\\'"); //Escape special characters
    QueryService<Customer> customerQueryService = new QueryService<Customer>(context);
    return customerQueryService.Where(m => m.DisplayName == displayName).FirstOrDefault();
}
}