none
Error on Open command using SQLConnection

    Question

  • Hi people,

    I got two Vb.Net applications that connects to the exact same server, using the exact same code, just in different Data Bases... I use a Connection String like this:
    "Data Source=xx.xxx.xx.xxx;Initial Catalog=ibptax;Persist Security Info=True;User ID=sa;Password=xxxxx"
    (obs.: I'm using 'sa' user to guarantee that is not an user access problem)

    In the vc.Net code I use:
            Dim con As New System.Data.SqlClient.SqlConnection
            con.ConnectionString = strConex
            con.Open()

    this way, in the first Application, works very fine...

    For some reason that I can't understand, in the second application I got the exact same code, doing the exact same thing, to the exact same SQL Server, only another DataBase, both applications using "sa" user, but it doesn't work...
    Using my proxy to collect what is going out of my machine, in the second application when execute con.Open the application tries to do something using 445 port and the server than returns error...

    Somebody knows what It can be?

    Error above:

    System.Data.SqlClient.SqlException (0x80131904): Erro de rede ou específico à instância ao estabelecer conexão com o SQL Server. O servidor não foi encontrado ou não estava acessível. Verifique se o nome da instância está correto e se o SQL Server está configurado para permitir conexões remotas. (provider: Named Pipes Provider, error: 40 - Não foi possível abrir uma conexão com o SQL Server) ---> System.ComponentModel.Win32Exception (0x80004005): O caminho da rede não foi encontrado     em System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)     em System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)     em System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)    
     em System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)     em System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)     em System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)     em System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions)     em System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)     em System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)     em System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions userOptions)     em System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions userOptions)     em System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)     em System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)     em System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)     em System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)     em System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)     em System.Data.SqlClient.SqlConnection.Open()     em Gerente_2012_Cloud_GerenciamentoDeMasters.utils.AbrirDataTable(String sql) na D:\_Trabalho_ParanaSoftware\Gerente 2012 Cloud_GerenciamentoDeMasters\Gerente 2012 Cloud_GerenciamentoDeMasters\utils.vb:linha 627     em Gerente_2012_Cloud_GerenciamentoDeMasters.utils.ControleDeAcessoPrincipalViaRegistro() na D:\_Trabalho_ParanaSoftware\Gerente 2012 Cloud_GerenciamentoDeMasters\Gerente 2012 Cloud_GerenciamentoDeMasters\utils.vb:linha 1096  ClientConnectionId:00000000-0000-0000-0000-000000000000

    Thursday, July 11, 2013 7:37 PM

Answers