Problem connecting to SQL Server 2012 database in IIS

6

I can not run queries from my system in IIS, when I run in Visual Studio I get the result quietly.

The error I get when trying to do something is as follows:

  

System.Data.Entity.Core.ProviderIncompatibleException: An error   occurred while getting information provider from the database. This   can be caused by Entity Framework using an incorrect connection   string. Check the inner exceptions for details and ensure that the   connection string is correct. --- >   System.Data.Entity.Core.ProviderIncompatibleException: The provider   did not return the ProviderManifestToken string. --- >   System.Data.SqlClient.SqlException: Network or specific error   instance when you connect to SQL Server. O   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.   (provider: SQL Network Interfaces, error: 50 - An error occurred   Local Database Runtime. Can not create an automatic instance. See the   Windows Application event log for error details. )

EDIT

This is my connection string:

<add name="db" connectionString="Data Source=(localdb)\V11.0;Initial Catalog=HomeAutomexdb;Integrated Security=True" providerName="System.Data.SqlClient"/>

If you need more information, please just let us know.

    
asked by anonymous 22.03.2014 / 03:06

2 answers

4

Is port 1433 freed on the firewall of the server that has the database?

If you are not running the steps already answered here on this page by another user.

Is the database on the same server as the site?

If it is not, follow these steps below, because in your connectionstring is LOCAL, and then we need to put the name of the server that is the bank.

There are 8 super simple steps, I believe that this will have no error, and if it occurs, you will have to put it here to discuss it, because it will be easier to map where the problem is:

    
27.03.2014 / 05:28
3

See if this can solve your problem.

Removed from site: angmaximo.wordpress.com

Open the SQL Server Configuration Manager console and go to the SQL Server Network section Configuration:

InProtocolsforMSSQLSERVER,orProtocolsforSQLEXPRESSdependingonyourversion,makesureTCP/IPisenabledasshowninthefigure.TCP/IPEnabled

ThenrightclickonitandselectEnable.

BydefaultSQLServerisinstalledwithport1433,checkthisbyright-clickingoverTCP/IPandselectingtheoptionProperties(Propriedades).

In the IP Addresses tab, you will see that there are several references to IP addresses (IP1, IP2 through IPALL), and for each IP there are 2 fields: TCP Dynamic Ports and TCP Port. TCP Dynamic Ports with value 0 indicates that SQL Server will listen for dynamic ports, and in TCP Port a port value will be set;

Then, by default, make sure you are using 1433 the TCP Port options, unless you need another port number.

Done, just click OK, so you probably could access it.

    
22.03.2014 / 14:01