Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8742713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:32:49+00:00 2026-06-13T11:32:49+00:00

I am trying to fetch google distances in gridview RowDataBound with a force sleep

  • 0

I am trying to fetch google distances in gridview RowDataBound with a force sleep of 1000ms,Nothing helping,Am getting correct distance for the first query,ie the first row of the gridview, all others i get ‘Over-Query-Limit’ for content variable ,I want to know three things:

  • Is there any solution for this situation.
  • Is google limiting queries per day OR
  • Is google limiting queries per second ?
public int getDistance(string origin, string destination)
    {
        System.Threading.Thread.Sleep(1000);
        int distance = 0;
        string url = "http://maps.googleapis.com/maps/api/directions/json?origin=" + origin + "&destination=" + destination + "&sensor=false";
        string requesturl = url;
        string content = fileGetContents(requesturl);
        JObject o = JObject.Parse(content);
        try
        {
            distance = (int)o.SelectToken("routes[0].legs[0].distance.value");
            return distance;
        }
        catch
        {
            return distance;
        }
        return distance;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:32:50+00:00Added an answer on June 13, 2026 at 11:32 am

    Ok,As above 2500 queries per day makes google search a paid service i went for another logic,We can calculate distances without google.com as follows :

        public decimal calcDistance(decimal latA, decimal longA, decimal latB, decimal longB)
        {
    
            double theDistance = (Math.Sin(DegreesToRadians(latA)) *
                    Math.Sin(DegreesToRadians(latB)) +
                    Math.Cos(DegreesToRadians(latA)) *
                    Math.Cos(DegreesToRadians(latB)) *
                    Math.Cos(DegreesToRadians(longA - longB)));
    
            return Convert.ToDecimal((RadiansToDegrees(Math.Acos(theDistance)))) * 69.09M * 1.6093M;
        }
    
        public double DegreesToRadians(decimal degrees)
        {
            return Convert.ToDouble((Convert.ToDecimal(Math.PI) / 180.0M) * degrees);
        }
    
        public double RadiansToDegrees(double radians)
        {
            return Convert.ToDouble((180.0M / Convert.ToDecimal(Math.PI)) * Convert.ToDecimal(radians));
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to fetch URLs using Google App Engine's urlFetch service and implement
I am trying to fetch my user's emails with google api & curl, and
I am trying to fetch the data from a google docs spreadsheet and I
I am trying to fetch the email-address of the user through the Google UserInfo
I'm trying to use the google maps API to fetch direction times. I'm hoping
I'm trying to fetch data of some https website from google appengine (java). There
I am trying to fetch the html source from this usl: http://books.google.com/books?id=NZlV0M5Ije4C&dq=isbn:0470284889 I used
I am trying to fetch this from a file: BEGIN_SEREFERRALS 2 google 13 15
I'm getting (NaN, NaN) when I trying to fetch the latitude and longitude information
I'm trying to fetch associations of a model dynamically. For ex; model1 has_many model2s

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.