Results 1 to 9 of 9

Thread: [RESOLVED] Scan Network for Specific Server

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2008
    Posts
    81

    Resolved [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

  2. #2
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Scan Network for Specific Server

    Why not connect by name?
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2008
    Posts
    81

    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

  4. #4
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2008
    Posts
    81

    Re: Scan Network for Specific Server

    I will test asap ...If this work it would be lifesaver

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 2008
    Posts
    81

    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

  7. #7
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Oct 2008
    Posts
    81

    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....

  9. #9
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width