无过载方法'查询'需要5 Salesforce的参数 [英] No overload for method 'query' takes 5 arguments salesforce
问题描述
我与Salesforce的API连接,我已经导入Salesforce的企业WSDL到我的项目。
我可以验证用户,但我有问题,而quering记录,我不知道还有什么我失踪,如何解决这个
没有过载方法'查询'需要5个参数
块引用>
//创建SOQL查询语句
查询字符串=SELECT姓名,账户号码,BillingState从户口所在BillingState ='CA';
enterprise.QueryResult结果= queryClient.query(
头,// sessionheader
空,// queryoptions
空,// mruheader
空, // packageversion
查询);
//投的查询结果
IEnumerable的< enterprise.Account>为accountList = result.records.Cast< enterprise.Account>();
//显示结果
的foreach(在为accountList VAR帐户)
{
Console.WriteLine(的String.Format(帐户名:{0},账号。名称));
}
解决方案此错误是由于差异在数量的参数的传递 定义的方法和 呼叫的。你已经通过了
$ B $的正确的计数b5
的参数应用于查询
方法和定义可能会有所不同的参数的计数。检查查询
方法的参数的计数,然后通过的参数的调用时。I am connecting with salesforce api , I have imported Salesforce enterprise Wsdl to my project. I can authenticate user but I am having Problem while quering records, I'm not sure what else I am missing and how to solve this
No overload for method 'query' takes 5 arguments
//create SOQL query statement string query = "SELECT Name, AccountNumber, BillingState FROM Account WHERE BillingState = 'CA'"; enterprise.QueryResult result = queryClient.query( header, //sessionheader null, //queryoptions null, //mruheader null, //packageversion query); //cast query results IEnumerable<enterprise.Account> accountList = result.records.Cast<enterprise.Account>(); //show results foreach (var account in accountList) { Console.WriteLine(string.Format("Account Name: {0}", account.Name)); }
解决方案This error is due to difference in number of parameters pass in definition of method and calling. You have passed
5
parameters to thequery
method and in definition may be different parameters count. Check thequery
method parameters count and then pass correct count of parameters when calling.这篇关于无过载方法'查询'需要5 Salesforce的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!