Search code examples
sql-servervb.netvisual-studio-2008sql-server-2014windows-mobile-6.5

Can't connect from Application


  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim StringConexao As String = "Server=some_ip,1433;Database=MyDatabase;User ID=sa;Password=sa;Connection Timeout=30"
    Dim conn As New SqlConnection(StringConexao)

    Try
      conn.Open()
      MessageBox.Show("Connected")
    Catch ex As Exception
      MessageBox.Show("Not successful")
    End Try
  End Sub

I'm trying to connect an Windows Mobile 6.5 application to SQL Server 2014.

Environment:

  • VM#1 Serving SQL 2014, installed with most defaults.
  • VM#2 with VS 2008 connecting ok with an Motorola MC55A

I can connect to SQL Server from the VM#2, from my host OS, from any other vm on the machine. All but the [put your bad word of choice here] Motorola MC55A connected through USB to VM#2.

Above is an sample code to connect the database. The real code is almost equal, except it gets the connection string from an configuration file - and yes, the connection string is fine.

That code worked to connect for years on SQL Server 2008, but since it got to use SQL Server 2014, it refuses to connect.

No amount of Googling gave an approach to this.

What I have learned so far:

  • I can connect the server VM#1 to an Cassini static html web site (hello world) from the Internet Explorer of the device on another port. So the VM#1 is reachable
  • All firewall issues were tracked down ( and all Windows Firewall in the way are turned off)
  • All machines - virtual or physical -connects without problem to SQL Server 2014. All except the device.
  • The same database code used on device, with very little change in the imports to strip the barcode reading libraries, works on 2014 if used from Winforms application.
  • The VM#2 can connect to SQL Server and I can telnet to it.
  • And I discovered when just about to send this question, that it connects to database if I run that simple application through debugger

What changed or what am I doing wrong?


Solution

  • Believe or not, the issue that's creating confusion was the proxy configuration of IE 6 (the develop vm is an WinXP) pointing to an old config, so the socks was resolving to internet! Half a day lost...