Click here to Skip to main content
15,884,783 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I try to import Gmail Contacts. I have this block code:

C#
public void GetGmailContacts(string p_name, string login, string password)
{
    RequestSettings rs = new RequestSettings(p_name, login, password);
    rs.AutoPaging = true;
    ContactsRequest cr = new ContactsRequest(rs);
    Feed<Contact> f = cr.GetContacts();
    foreach (Contact t in f.Entries)
    {
        foreach (EMail email in t.Emails)
        {
            DataRow dr1 = dt.NewRow();
            dr1["emailid"] = email.Address.ToString();
            dt.Rows.Add(dr1);
        }
    }
}


But in this row:
C#
foreach (Contact t in f.Entries)

I get this exception:

Execution of request returned unexpected result: http://www.google.com/m8/feeds/contacts/default/fullMovedPermanently

Any idea why do I get this exception and how to solve it?
Thank you for advance.
Posted
Comments
AmitGajjar 14-Apr-14 19:56pm    
can you add try..catch and get exact exception message ?
Mich_90 14-Apr-14 20:41pm    
This message I get in catch block.
AmitGajjar 14-Apr-14 20:43pm    
is your f variable is empty ? can you please check that ?

Install-Package Google.GData.Contacts from your nuget pm your issue will be resolved
 
Share this answer
 
@QoSi QuReshi
still not working...!!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900