none
On-Demand Switching between LAN and WiFi RRS feed

  • Question

  • Hello,

    I would like to deploy a solution on a Surface Pro that's intended to be docked / undocked at will (using the new Surface docking station). This scenario implies that I would be switching between the LAN (docked) and the Wireless (undocked) in a private subnet. The Surface runs a client application that requires a database server. My question is this: what events or properties can I implement in the Client application code that will allow me to manage the changing connections and maintain my database connection?

    Thanks in advance...

    Markb


    mjb

    Thursday, February 6, 2014 11:29 PM

Answers

  • Hi,

    May I know whether you are creating a Windows Store app? If so, the NetworkStatusChanged event can be used to get notifications when network status changed. In the event handler, you can get the network connection profile and more detailed properties such as network adapter (which could tell whether it is wifi or LAN). Please refer to http://msdn.microsoft.com/en-us/library/windows/apps/hh700376.aspx for a tutorial. It uses JavaScript, but the same approach can be used for XAML apps. If any further help is needed, you can also post a thread on Windows Store apps forum.

    Best Regards,

    Ming Xu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by mark baran Wednesday, February 12, 2014 1:18 PM
    Friday, February 7, 2014 9:22 AM

All replies

  • Hi,

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 7, 2014 5:55 AM
    Moderator
  • Hi,

    May I know whether you are creating a Windows Store app? If so, the NetworkStatusChanged event can be used to get notifications when network status changed. In the event handler, you can get the network connection profile and more detailed properties such as network adapter (which could tell whether it is wifi or LAN). Please refer to http://msdn.microsoft.com/en-us/library/windows/apps/hh700376.aspx for a tutorial. It uses JavaScript, but the same approach can be used for XAML apps. If any further help is needed, you can also post a thread on Windows Store apps forum.

    Best Regards,

    Ming Xu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by mark baran Wednesday, February 12, 2014 1:18 PM
    Friday, February 7, 2014 9:22 AM
  • Thank you for your response. This is not a store app, however. We have a WinForms application, built in Visual Studio and running on Windows 7 that we've moved to the Surface Pro platform and Windows 8.

    The NetworkStatusChanged event sounds promising. Can I find that in a .NET namespace?


    mjb

    Friday, February 7, 2014 7:20 PM
  • When you undock you will loose the IP address on the wired network adapter, and any TCP/IP connections will be severed.  This will tear down all your SQL Server sessions, and you will need to reconnect. 

    If your application opens and closes the connections when needed, instead of keeping a single SqlConnection open, then the built-in connection pooling behavior should make undocking seamless unless you undock in the middle of running a query.

    David


    David http://blogs.msdn.com/b/dbrowne/

    Friday, February 7, 2014 7:28 PM