Unable to connect to Network.

  • Thread starter Thread starter mydooodle
  • Start date Start date
M

mydooodle

Hi all,

I have created a small App in .Net 2005. The App uses a web service in
the local macine to query the database.
The result is to be displayed in the grid in Emulator.

Web Service is connecting fine with Windows App but not working with
Pocket PC App.
I am getting following error :
"Unable to connect to the Network".
just while running the application in Emulator.

I have tried various things like setting the URL property in code,
Connecting to the Emulator. Emulator displays the grid but on pressing
on load button the error pops up.

Code :
private void btnLoad_Click(object sender, EventArgs e)
{

FirstAppIIS.Service oUserService = new
FirstAppIIS.Service();
//oUserService.Url = "http://localhost:1232/FirstApp/
Service.asmx";
oUserService.Url = "http://kavitahome/FirstAppIIS/
Service.asmx";
DataSet dsUser = new DataSet("User");
dsUser = oUserService.ReturnData();
ugdUser.DataSource = dsUser.Tables[0];
ugdUser.Refresh();
}

I have tried with local host as well as machine name. No chances.

Any help would be highly praised.

Regards,
Bhoomi.
 
Localhost certainly won't wok - it implies the service is on the emulator.

A machine name may or may not work, depending on how you're connected. I
don't think it will work through ActiveSync, as it probably doesn't pass
through DNS requests.

The best advice is to use a real device.
 
In order to get this to work you will need to configure IIS to listen on the
loopback network that ActiveSync uses (With WM5 and onwards makes this
easier) - a 169 address generally. Then in your pocket pc code, use this 169
to connect to rather than relying on DNS as your device needs to see a DNS
server for name resolutions to work.
 
Back
Top