我使用此web服務http://www.webservicex.com/globalweather.asmx?WSDL以國家名稱獲取所有城市名稱。我用下面的代碼來獲得響應使用WSDL WebService填充組合框
GlobalWeatherReference.GlobalWeatherSoapClient weather = new GlobalWeatherReference.GlobalWeatherSoapClient("GlobalWeatherSoap12");
cities_cb.DataSource = weather.GetCitiesByCountry("Chad").ToList();
這將返回
string
<NewDataSet>
<Table>
<Country>Chad</Country>
<City>Sarh</City>
</Table>
<Table>
<Country>Chad</Country>
<City>Abeche</City>
</Table>
<Table>
<Country>Chad</Country>
<City>Moundou</City>
</Table>
<Table>
<Country>Chad</Country>
<City>Ndjamena</City>
</Table>
<Table>
<Country>Chad</Country>
<City>Bokoro</City>
</Table>
<Table>
<Country>Chad</Country>
<City>Bol-Berim</City>
</Table>
<Table>
<Country>Chad</Country>
<City>Am-Timan</City>
</Table>
<Table>
<Country>Chad</Country>
<City>Pala</City>
</Table>
<Table>
<Country>Chad</Country>
<City>Faya</City>
</Table>
</NewDataSet>
現在我需要通過城市名稱來填充組合框。請幫忙。