Error connecting to database via Visual Studio

Asked

Viewed 249 times

1

I am trying to add a database to my application, the first I got, however when trying to add another database is returned me the following error:

A network-Related or instance-specific error occurred while establishing a Connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote Connections. (Preview: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for details of the error.

These are my 2 connectionsString, but I only managed to add the first one (ASP_NET_MVC_CS):

<connectionStrings>
<add name="ASP_NET_MVC_CS" connectionString="Data Source=ARTHUR\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASP_NET_MVC_DB.mdf; Persist Security Info = True; User ID=sa;Password=*******; MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />
<add name="IndetityDB" connectionString="Data Source=ARTHUR\SQLEXPRESS;AttachDbFilename=|DataDirectory|\IdentityDb.mdf;Persist Security Info = True; User ID=sa;Password=********; MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />
    </connectionStrings>

What is the reason for the error?

  • This looks like network error or SQL process stopped on the server.

  • Check that the access settings of the second database (which does not work) are the same as the first database (which works). And another thing, you didn’t misspelle that "Indetitydb" shouldn’t be "Identitydb"? Or this is wrong "Identitydb.mdf".

  • putsss I’m sorry to fail, the mistake was just that, was wrong the name. Thank you very much for the tip.

  • No problem! @Desalex

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.