Problem connecting to SQL Server 2012 database on IIS

Asked

Viewed 26,381 times

6

I cannot run my system queries on IIS, when running in Visual Studio I can get the result easily.

The mistake I get when I try to do something is this::

System.Data.Entity.Core.Providerincompatibleexception: An error occurred while Getting Provider information 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 a Providermanifesttoken string. ---> System.Data.Sqlclient.Sqlexception: Network or specific error the instance when connecting to SQL Server. The server was not found or was not accessible. Check that the instance name is correct and SQL Server is configured to allow remote connections. (Preview: SQL Network Interfaces, error: 50 - Error Local Database Runtime. Cannot create an Automatic instance. See the Windows Application Event log for error Details. )

EDIT

This is my string Connection:

<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.

  • Did you enable TCP/IP communication in SQL Server by SQL Server Configuration? If you can post your connectionString it would be nice, just change user and password to something like ***, and change whatever else you don’t want to be shown with the correct name, thus changing to a "fake name".

  • 1

    In SQL Server Configuration TCP/IP is enabled. I added the Connection string

  • Ok, so I believe your problem is the user, since you are Security Integrated. Try putting a user and password. Example: connectionString="Data Source=(localdb)\V11.0; Initial Catalog=HomeAutomexdb; User Id=Administrator; Password=123456".

  • Another thing, why give (localdb)? Try changing only to (local)\V11.0, or with the instance name as well: (local)\MSSQLSERVER.

  • The server name also: Data Source=SERVIDOR\MSSQLSERVER.

  • In SQL Server 2012 I could only log into the local database using the name of the server this way. Switching to local I can not connect.

  • Failed to set a username and password?

  • I didn’t try, I was using windows authentication same

  • The problem with windows appliance in the context of IIS is that it is not you, as in a console appliance or in the local Visual Studio, but it is the service or windows Account of the Application Pool below which the site was configured in IIS. For a quick test, you can set up Application Pool Identity with your windows Account...but any other senator needs a 'service Account' or other system to authorize the user credentials.

Show 4 more comments

2 answers

4

Port 1433 is cleared in the server firewall that has the bank?

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

The bank is on the same server as the website?

If not, perform 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 with this you will not have error, and if it occurs you will have to print and put here to discuss about, because this way it will be easier to map where the problem is:

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

  • this is a beautiful way to assemble the connectionstring, +1 by creativity

3

See if this can solve your problem.

Taken from the site: angmaximo.wordpress.com

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

SQL Server Configuration Manager

In Protocols for MSSQLSERVER, or Protocols for SQLEXPRESS as per your version, check if the TCP/IP option is enabled as shown in the picture. TCP/IP Enabled

Then right-click on it and select Enable.

By default SQL Server is installed with port 1433, check this by right clicking on TCP/IP and select the option Properties (Propriedades).

Configurações TCP/IP

In the IP Addresses tab, you will see that there are several references to IP addresses (IP1, IP2 up to 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;

So by default, make sure you’re with 1433 the options TCP Port, unless you need another port number.

Once this is done just click OK, then you will probably be able to access.

Browser other questions tagged

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