Iterate through all items in web service...

Results 1 to 2 of 2

Thread: Iterate through all items in web service...

  1. #1
    Join Date
    Dec 1969

    Default Iterate through all items in web service...

    I am trying to iterate through all of the data in a webservice without having to explicitly call the methods. I tried to bind the service to a datagrid with no avail.<BR><BR>Dim objService As New com.ejse.www.Service()<BR>Dim ar As IAsyncResult = objService.BeginGetNineDayForecastInfo(89118, Nothing, Nothing)<BR>ar.AsyncWaitHandle.WaitOne()<BR><BR>Di m dgService As New DataGrid()<BR>dgService.DataSource = objService.EndGetNineDayForecastInfo(ar)<BR>dgServ ice.DataBind()<BR><BR>When I try this I get:<BR>An invalid data source is being used for dgWeather. A valid data source must implement either IListSource or IEnumerable.<BR><BR>I tried to add a dataset but it says that objService.EndGetWeatherInfo(ar) cannot be converted to a dataset.<BR><BR>It does work if I do something like this:<BR>With wbsrvcWeather.GetExtendedWeatherInfo(89121)<BR> Response.Write(.Day1.Date)<BR> Response.Write(.Day1.Day)<BR> Response.Write(.Day1.Forecast)<BR>End With<BR><BR>...but this is what I am trying to get away from. Any help is greatly appreciated.<BR>

  2. #2

    Default RE: Iterate through all items in web service...

    Why async?<BR><BR>What object/class does objService.EndGetNineDayForecastInfo(ar)<BR>return ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts