[RESOLVED] Scan Network for Specific Server
Hello to everybody,
i have this little thing bugging and i haven't found a solution yet.
I have an application that connects to a remote SQL Server to drill some data.Although server's IP never changes there is a chance that something happens and this IP is changed.Given the fact that the connection string for SQL user IP address only i need to know if there is some way to scan my network (lets say it goes from 192.168.1.xx to 192.168.2.xx) for the specific server (i will call him Svr02) and return it's IP address.
Thanks in advance
Re: Scan Network for Specific Server
Re: Scan Network for Specific Server
This is not possible....i have tried a couple of times but no luck.It is also mentioned clearly to several sites that show how to connect a pda to sql server.It is some what bizzare but it is true.Plz check it by urself i would be most interested to solve this
Take a look here
http://netcf2.blogspot.com/2005/12/a...ress-from.html
Just take a look at the first comments
Re: Scan Network for Specific Server
I use a server name/instance to connect wirelessly from PDA's and it works fine. I know at one point, it was said it didn't work, but it does, although I use a different port.
A string that works is...
Persist Security Info=False;Integrated Security=False;Server=Till1\SqlExpress,39250;initial catalog=Waiter;user id=sa;password=xxxxxxxx;
Pete
Re: Scan Network for Specific Server
I will test asap ...If this work it would be lifesaver
Re: Scan Network for Specific Server
Some Late Response
I think i have found it
Dim ServerIp As IPAddress
ServerIp = Dns.GetHostEntry("YourServerName.domain.TheNameofyourDomain.com").AddressList(0)
And you get the IP...:)
Please take a note that it needs the full computer name
Re: Scan Network for Specific Server
That can take a long time - I think the servername in the connection string is quicker and more flexible :)
Re: Scan Network for Specific Server
I gave it a quick try with the servername as u suggested and it failed.Unfortunately i am under pressure right now to make some more tests but the solution i gave works fine even for the emulator.And the time is about 1-2 seconds to make the resolving.Possibly this could work as a fail safe..if something goes wrong....
Re: Scan Network for Specific Server
If you get the server name long though, it will go away for a long time
Good solution, just pointing out potential pitfalls :)
Pete