sisquo76
Active member
I added web reference to a project. Web Service has GetCountries web method and returns DataSet. I need those data in listbox. I figured how to do this, but i wonder is this a proper way?
VB.NET:
Public Class Form1
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Dim a As New com.ezzylearning.www.CountryInformationService
Dim Countries As DataSet = a.GetCountries
Dim countryList As New List(Of String)
For Each dr As DataRow In Countries.Tables(0).Rows
countryList.Add(dr.Item(2).ToString)
Next
Me.ListBox1.DataSource = countryList
End Sub
End Class