#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2015
    Posts
    6
    Rep Power
    0

    Problem With Fetching Contact List From Gmail Account


    Hello Friends,

    I am working on module in asp.net, my task is to get all contact list from Gmail Account,
    I have done coding part but it is not working it is showing error
    "Execution of authentication request returned unexpected result: 404"
    i also have attach my coding file...
    please help me in same

    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Google.GData.Contacts;
    using Google.GData.Extensions;
    using Google.GData.Client;
    using Google.Contacts;
    using System.Data.SqlClient;
    using System.Data;
    
    namespace GetDetailsOfGmail
    {
        public partial class WebForm1 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
    
            protected void Button1_Click(object sender, EventArgs e)
            {
                DataSet ds = new DataSet();
                ds.Tables.Add("GmailContacts");
                ds.Tables[0].Columns.Add("EmailId");
                RequestSettings rs = new RequestSettings("myApp", txtUserName.Text,       txtPassword.Text);
                rs.AutoPaging = true;
                ContactsRequest cr = new ContactsRequest(rs);
                Feed<Contact> f = cr.GetContacts();
                foreach (Contact contact in f.Entries)
                {
                    foreach (EMail email in contact.Emails)
                    {
                        DataRow row = ds.Tables[0].NewRow();
                        row["EmailId"] = email.Address.ToString();
                        ds.Tables[0].Rows.Add(row);
                    }
                }
                GridView1.DataSource = ds.Tables[0];
                GridView1.DataBind();
                lblStatus.Text = "Total Contacts For" + txtUserName.Text + " : " + ds.Tables[0].Rows.Count.ToString();
            }
        }
    }
    Thanks in advance
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2006
    Posts
    507
    Rep Power
    15

IMN logo majestic logo threadwatch logo seochat tools logo