I'm developing a windows application using visual studio 2017, however I came across a problem, on my machine I'm doing the project everything runs right, on the other machine that tests the connection error with the bank, I already installed the correct version of .NET and SQL SERVER, I dropped the folder in the same place as the one on the other machine on the C: drive. I'm using the app.config for the connection to the database. I find it strange that the connection does not require user and bank password (I am still learning C # and knowing visual studio).
I'm programming on a machine with windows 10 and testing and another machine with windows 7
App.Config
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="conn"
connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Sistema\Sistema.mdf;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
The error is this:
************** Texto de Exceção **************
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: SQL Network Interfaces, error: 26 - Erro ao Localizar Servidor/Instância Especificada)
em System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
em System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
em System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity)
em System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject)
em System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout)
em System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
em System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
em System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
em System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
em System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
em System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
em System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
em System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
em System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
em System.Data.SqlClient.SqlConnection.Open()
em WindowsFormsApp1.formLogin.acessar_Click(Object sender, EventArgs e) na C:\Sisgemp\formLogin.cs:linha 44
em System.Windows.Forms.Control.OnClick(EventArgs e)
em System.Windows.Forms.Button.OnClick(EventArgs e)
em System.Windows.Forms.Button.PerformClick()
em System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
em System.Windows.Forms.Control.ProcessDialogKey(Keys keyData)
em System.Windows.Forms.Control.PreProcessMessage(Message& msg)
em System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
em System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)