2

I have developed a tiny app in vb.net cf that connects to sqlserver 2008 via wifi. Testing it, I turned off wifi switch, app exits correctly. Turned wifi on, started the app. However, it says that sqlserver cannot be reached. cnn.open() failed miserably. The weird part of this is when I put the pda on its cradle and syncs with ActiveSync the app runs perfectly. It seems that ActiveSync resets some port or process that enables the connection with SqlServer again.

So, the question is, why I cannot reconnect to sqlserver after wifi loss, unless I do a new ActiveSync reconnection???

PDA: Motorola MC919Z handheld rfid enabled

OS: Windows Mobile 6.5.3 WWE

    Dim cnn As New SqlConnection("Data Source=192.168.0.40\serverInstance;Initial Catalog=MyBase;Persist Security Info=True;User ID=usr;password=pwd")
    cnn.Open() 'runs ok 1st time, but turned wifi off, exit app, turned wifi on, app crashes here!
raiseerco
  • 31
  • 1
  • 3

1 Answers1

0

Are you sure the connection doesn't somehow stay active in your SQL server? Maybe your app cannot reconnect because your server port is busy. That code line seems to be Ok, so try to restart your sql server after dropping your wifi just to see if your app can reconnect. If so, you will have to config your server so port is set free after x inactive time.

Hope it helps.

Eduardo Soriano
  • 184
  • 1
  • 12