Constant Contact utility.searchbyemail()

时间:2012-11-13 21:36:50

标签: c# asp.net constantcontact

我正在尝试使用Utility.searchbyemail选项检查联系人是否存在。

示例: IList myList = Utility.SearchContactByEmail(authdata,emailAddress,out nextChunkId);

上述语句抛出错误:错误无法将类型'System.Collections.Generic.IList'隐式转换为'System.Collections.Generic.IList'。存在显式转换(您是否缺少演员?)

非常感谢任何帮助。下面是我的代码供参考,我希望我有所有名称空间。

enter code here
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using ConstantContactBO;
using ConstantContactUtility;
using System.Data;
using System.Data.SqlClient;

namespace WebApplication4
{
public partial class WebForm1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ConstantContactBO.Contact c = new ConstantContactBO.Contact();
        c.EmailAddress = "";
        AuthenticationData authdata = new AuthenticationData();
        authdata.Username = "";
        authdata.Password = "";
        authdata.ApiKey = "";

        // get user Contact List collection
        string nextChunkId;
        string currentChunk;
        string x = "a@abc.com";
        string[] emailAddress = new string[]{x.Trim()};
        IList<ContactList> lists = Utility.GetUserContactListCollection(authdata, out nextChunkId);
        **IList<Contact> myList = Utility.SearchContactByEmail(authdata, emailAddress, out nextChunkId);** //Throws Error here
    }
}
}

1 个答案:

答案 0 :(得分:0)

我解决了。问题在于使用命名空间WebApplication4。