Avatar of phoenixfire425
Flag for United States of America asked on

Google Maps with ASP.net and SQL

I have neem looking for the last few days on something that can help me and so far i cannot find anything that really helps.

What i am trying to do is this.

I have a Customer Database that has approx 300-6000 customers in it depending on the user that logs on. typically its 300 or less.

The customer DB does not have the Long and Lat saved with it.

But what i am trying to do is show a map of the customers that are in the SQL reaults on a single map.

So for instance Joe Smoe wants to see all his customers in the 12345 zip code... the asp.net page querys the SQL DB and pulls out 100 customers in that range.   I want those 100 customers to be populated on a map so the REP can see what that area looks like.

Also i would like to be able to control the icons as well to show inactive and active customers.

I am using

MS SQL 2000
Visual Studio 2008 Express

Thank You
Microsoft SQL ServerASP.NETWeb ApplicationsSQL

Avatar of undefined
Last Comment

8/22/2022 - Mon
Luis Pérez

Well, if you don't have Latitude and Longitude you'll not be able to exactly locate each customer in a map. The most you can do is trying to locate the customer in the map using it's address, but it's not sure that you'll get an exact location for all customers.

To start with google maps basics, I will recommend to you this custom ASP.net control that has a free version you can use without restrictions:

With this control you can easy & fast begin to show maps, locate icons where you want, paint icons, do address searches, etc. without the need to learn the Google Maps API.

Hope that helps.

Well i have tried to get the control to work with http://googlemaps.subgurim.net/ but i cannot find any way to get out customer information into the maps.  


I guess a good start would be to build the GEOCODE database and store the resaults into a table on the SQL server. but the only way i know of doing that would be doing it line by line.

I know that http://geocoder.us has a free geocoder but i dont know how to send my data to that and get the resaults back for storing them.

Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy

Ok so far what i have is i am able to geocode and place the info into a gridview.
but i need to find out how to pull the data from my DB

in the code behind i have tge address set staticly..

What i need is to be able to use a DB query to populate the address field

or i am open to other solutions.
Imports System.Data
Imports System.Xml
Imports System.Net
Partial Class Testing
    Inherits System.Web.UI.Page
    Private Function GetLocation() As DataTable
        'Create a WebRequest 
        Dim rssReq As WebRequest = WebRequest.Create("http://local.yahooapis.com/MapsService/V1/geocode?appid=YD-9G7bey8_JXxQP6rxl.fBFGgCdNjoDMACQA--&street=1 cedar point dr&city=sandusky&state=oh")
        'Create a Proxy 
        Dim px As New WebProxy("http://local.yahooapis.com/MapsService/V1/geocode?appid=YD-9G7bey8_JXxQP6rxl.fBFGgCdNjoDMACQA--&street=1 cedar point dr&city=sandusky&state=oh", True)
        'Assign the proxy to the WebRequest 
        rssReq.Proxy = px
            'Get the WebResponse 
            Dim rep As WebResponse = rssReq.GetResponse()
            'Read the Response in a XMLTextReader 
            Dim xtr As New XmlTextReader(rep.GetResponseStream())
            'Create a new DataSet 
            Dim ds As New DataSet()
            'Read the Response into the DataSet 
            Return ds.Tables(0)
            Return Nothing
        End Try
    End Function
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        Dim dt As DataTable = GetLocation()
        Me.GridView1.DataSource = dt
        Me.GMap1.DataSource = dt
    End Sub
End Class

Open in new window



Eehh.. Have you even checked out the answer I provided to your OTHER question on this subject?



View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.