How To: Live Search 101

I have recently started playing with some of the Live Services available at There are some pretty interesting Web Services they have been putting together. I started playing with the Live Search Service you can find at The following is a simple example to show how to use this service with VB.


Before using this you will need to get a developer token at

This is required for the example.


In this example we will create a very simple Windows form application that uses the Live Search Service.

1.       Create a new Windows form application that contains the following controls named as shown


2.       In the code behind BTNSearch enter the following code

Private Sub BtnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSearch.Click

        If TxtSearch.Text = "" Then

            MsgBox("Please Enter a search string")


            Dim searchRequest As New


            Dim NewRequest(0) As

            NewRequest(0) = New

            NewRequest(0).Source =

            NewRequest(0).ResultFields =


            searchRequest.Query = TxtSearch.Text

            searchRequest.Requests = NewRequest


            ' Replace with your own developer ID from


            searchRequest.CultureInfo = "en-US"


            Dim SearchService As New

            Dim SearchResponse As New

            SearchResponse = SearchService.Search(searchRequest)


            With DataGridView1

                .AutoGenerateColumns = True

                .DataSource = SearchResponse.Responses(0).Results

                .AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders


                ' Set the DataGridView control's border.

                .BorderStyle = BorderStyle.Fixed3D


            End With

        End If

    End Sub


When the application is run it looks like the following

The Live Search guys have done a great job in providing an interactive SDK that you can find at . This SDK provides some pretty cool examples and additional information around using these API’s.