Hello,
VS 2005
I have created a Pocket that uses a web service to get data from a SQL server.
I have created the web refererence to the web service.
I am developing a pocket PC in WM 5.0
However, when I click a button on the PDA to get the data I get this error message "Cannot establish a connection to the network"
I am using active syn and have and using the emulator. This has been connected ok.
I have also configured the emulator from File | configure | Network and checked host only network. ( I don't think this makes much difference as the pocket 2003 i developed, it did not make much difference, as it worked if it was checked or not).
The code that causes the error is below:
If I add the Url line in, it works okCode:Try Dim ws As New DataIncidents.Service() Dim ds As New DataSet ds = ws.getIncidents() 'Dim cnnStr As String 'cnnStr = ws.getIncidents() Me.grdIncidents.DataSource = ds.Tables(0).DefaultView Catch ex As Exception MessageBox.Show(ex.Message) End Try
Its not good to have this line hard coded in the program as if the location is changed then the problem will no longer function.Code:Try Dim ws As New CodeRed.Service() ws.Url = "http://1.1.1.1/Incidents/Service.asmx" 'Works with this line Dim ds As New DataSet ds = ws.getIncidents() 'Dim cnnStr As String 'cnnStr = ws.getIncidents() Me.grdIncidents.DataSource = ds.Tables(0).DefaultView Catch ex As Exception MessageBox.Show(ex.Message) End Try
Can anyone tell me why I am getting this error.
Many thanks in advance,
Steve


Reply With Quote