2010-07-19 76 views

回答

0

首先,请从代码的Web服务背后... 然后绑定您从Web服务到一个下拉得到的XML。 在这个环节你必须怎么做:

http://forums.asp.net/t/999571.aspx

欢呼

+0

我已经叫 昏暗myGeoService作为新net.webservicex.www .country Dim myISOcodes As String = myGeoService.GetCountries 但myISOcodes只是字符串。接下来的问题是如何将字符串更改为数据集? – user168507 2010-07-19 10:33:30

+0

GetCountries返回什么? – Marko 2010-07-19 11:33:02

+0

在浏览器中打开 http://www.webservicex.net/country.asmx/GetCountries – user168507 2010-07-19 11:57:13

1

THX马尔科,最后:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
    Dim myGeoService As New net.webservicex.www.country 
    Dim myISOcodes As String = myGeoService.GetCountries 

    Dim reader As New System.IO.StringReader(myISOcodes) 

    If Not Page.IsPostBack Then 
     Dim mycountries As New DataSet 
     mycountries.ReadXml(reader) 
     DropDownList1.DataSource = mycountries 
     'DropDownList1.DataValueField = "value" 
     DropDownList1.DataTextField = "Name" 
     DropDownList1.DataBind() 
    End If 

End Sub 
+0

我很高兴我帮助过...干杯 – Marko 2010-07-19 22:12:30