I am trying to consume a web service using VS2008.
The code below works in VS2005 but not VS2008 I, suspecting it's to do with WCF. Please can someone help me to solve the puzzle?
'Old code that works
Dim o As New MyWebService.Name
Dim pr As New System.Net.WebProxy("100.0.1.1", 80)
pr.Credentials = System.Net.CredentialCache.DefaultCredentials
o.Proxy = pr
Dim ds As New DataSet
ds = o.GetMyData(Me.TextBox1.Text, "password")
Me.DataGridView1.DataSource = ds.Tables(0)
This is how im trying to do it with no success
Dim o As MyWebService.nameSoapClient = New MyWebService.nameSoapClient()
o.ClientCredentials = System.Net.CredentialCache.DefaultCredentials.GetCredential('lost here')
DataGridView1.DataSource = o.GetMyData(Me.TextBox1.Text, "password")