0

Utility.searchbyemail オプションを使用して、連絡先が存在するかどうかを確認しようとしています。

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

上記のステートメントはエラーをスローします。明示的な変換が存在します (キャストがありませんか?)

どんな助けでも大歓迎です。以下は参照用のコードです。すべての名前空間が適切に配置されていることを願っています。

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
    }
}
}
4

1 に答える 1

0

解決しました。この問題は、名前空間 WebApplication4 の使用にありました。

于 2012-11-13T22:12:59.223 に答える