Getting the IP address of the desktop machine from the device

G

Guest

Hi!
I am trying to get the IP address of the host computer from an app on the
device but it seems, the device gets it's own IP address. I need to find the
subnet in which the host computer belongs so that I can find out the sql
servers in the network.

Is this possible? Can you give me some ideas?

Thanks for your time.
Regards,
Kumar
 
P

Paul G. Tobey [eMVP]

How is the device connected to the 'host' and what do you mean by 'host', if
it's not connected via ActiveSync? If the device is using DHCP to get an IP
address, presumably it would be getting it from the same server as the
'host' is, so the subnets would be the same. If it's not dynamically
assigned, it will either be fine, allowing communication or invalid, in
which case, you aren't going to be able to get any network activity at all.

Paul T.
 
G

Guest

Thank you for responding Paul.

The device is connected via activesync. By 'host' I meant the computer with
which the device is connecting. The IP address of the computer is
xxx.xxx.1.115 and the device's IP address shows up as xxx.xxx.55.101. So when
I try to get the list of sql servers, I get an empty list.

With that information, what would you suggest?

Regards,
Kumar
 
P

Paul G. Tobey [eMVP]

You're trying to get the PC to route your network packets onto another
network. I don't think that's going to work for you. ActiveSync will do
some routing for you (you can use IE while you're connected and so one), but
expecting it to be a general-purpose router is a little much.

I'd suggest that, if you need to access the network as a real client, get a
network card and actually become a client. You might be able to come up
with something else that would work, but nothing that's really smooth and
consistent with what other clients on the network are able to do.

Paul T.
 
G

Guest

Thanks Paul. I guess I will step back and then think of a different approach
to get what I need :)

Regards,
Kumar
 
P

Paul G. Tobey [eMVP]

I suppose that you could have a text file stored on the desktop that is
synchronized with the PPC each time it connects and the server could keep
that up to date with a list of SQL servers. I don't know what you're going
to do with the information, even if you had it, though. Will ActiveSync
route requests for data to those servers, even you know their IP addresses?

Paul T.
 
G

Guest

Answering your question about 'what I will do with the information':

In our app, we don't use webservices or sql server ce. The app needs to
access a SQL server 2000 database on the LAN, the first time the app is run.
We have to perform some configuration settings. So I need to get the sql
servers available on the network and let the user choose the appropriate one.
After the user selects a sql server from the list, we intend to perform
another check by pinging that server to see if it exists.

I had posted a message specifically asking about how to list the sql servers
but since I didn't receive much info, I changed the approach to the problem.

Your suggestion about maintaiing a text file seems fine and I will give that
a try. Activesync won't transfer any data to the servers, it just acts as a
communicating mode.

I hope this information clears up the things, further.
Thanks for being patient.
Regards,
Kumar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top