无过载方法'查询'需要5 Salesforce的参数 [英] No overload for method 'query' takes 5 arguments salesforce

查看:148
本文介绍了无过载方法'查询'需要5 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},账号。名称));
}


解决方案

此错误是由于差异在数量的参数的传递 定义的方法 呼叫。你已经通过了 5 参数应用于查询方法和定义可能会有所不同的参数的计数。检查查询方法的参数的计数,然后通过的参数的调用时。

$ B $的正确的计数b

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 the query method and in definition may be different parameters count. Check the query method parameters count and then pass correct count of parameters when calling.

这篇关于无过载方法'查询'需要5 Salesforce的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆