Solved

Vb.net Code Snippet Errors

Posted on 2013-01-24
1
422 Views
Last Modified: 2013-01-25
Can Someone help me fix errors in this code?


I get errors on


 Error      1      Type 'GeocodeService.Credentials' is not defined.      

Error      2      Value of type '1-dimensional array of BTDT.GeocodeService.ConfidenceFilter' cannot be converted to 'System.Collections.ObjectModel.ObservableCollection(Of BTDT.GeocodeService.FilterBase)'.      

Error      3      'Geocode' is not a member of 'BTDT.GeocodeService.GeocodeServiceClient'.      

Error      4      The targeted platform does not support latebinding.



    Private Sub MakeGeocodeRequest()

        Dim Results As String
        Try
            ' Set a Bing Maps key before making a request
            Dim key = "Bing Maps Key"

            Dim geocodeRequest As New GeocodeService.GeocodeRequest()

            ' Set the credentials using a valid Bing Maps Key
            geocodeRequest.Credentials = _
            New GeocodeService.Credentials() With {.ApplicationId = "mykey"}

            ' Set the full address query
            geocodeRequest.Query = "1 Microsoft Way, Redmond, WA"

            ' Set the options to only return high confidence results
            Dim filters() As GeocodeService.ConfidenceFilter = _
            {New GeocodeService.ConfidenceFilter() _
            With {.MinimumConfidence = GeocodeService.Confidence.High}}

            Dim geocodeOptions As New GeocodeService.GeocodeOptions() _
            With {.Filters = filters}

            geocodeRequest.Options = geocodeOptions

            ' Make the geocode request
            Dim geocodeServiceInstance As New GeocodeService.GeocodeServiceClient("BasicHttpBinding_IGeocodeService")
            Dim geocodeResponse = geocodeServiceInstance.Geocode(geocodeRequest)

            ' Use the results in your application.
            Results = geocodeResponse.Results(0).DisplayName

        Catch ex As Exception
            Results = "An exception occurred: " & ex.Message

        End Try

    End Sub

Open in new window

0
Comment
Question by:Dodsworth
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 38815740
Make sure you have proper assembly references added to your project and Namespace imports added to your page.
Also check this.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question