0

The connection string works well on server, but I get an error when I run in my local SQL Server.

<add name="FoodDbConString" 
     connectionString="data source=LAPTOP-NF1LM193\SQLEXPRESS;Database=FoodData;" 
     providerName="System.Data.SqlClient" />

Server connection string :

<add name="FoodDbConString" 
     connectionString="Server=191.167.1.280;Database=FoodData;User Id=aa;Password=alpha@123;" 
     providerName="System.Data.SqlClient" />

Local Connection string : (Error)

<add name="FoodDbConString" 
     connectionString="data source=LAPTOP-NF1LM193\SQLEXPRESS;Database=FoodData;" 
     providerName="System.Data.SqlClient" />

Error:

System.Data.Entity.Core.EntityException: An exception has been raised that is likely due to a transient failure. If you are connecting to a SQL Azure database consider using SqlAzureExecutionStrategy.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Possible duplicate of [Error when connect database continuously](https://stackoverflow.com/questions/29840282/error-when-connect-database-continuously) – Circle Hsiao Aug 31 '19 at 13:58
  • I would verify that you can access the SQL Express database. So I would start by using SQL Server Management Studio and attempt to connect to the database. The login windows of SSMS has three options 1) Server Name 2) Instance of Server 3)Credentials which are usually Windows Credentials. These credentials are obtained from the user login account. The connection string you posted does not contain any credential info and is connecting to a SQL Express database. You may have a different version of SQL Server (requiring a different instance) or the credentials for the database are wrong. – jdweng Aug 31 '19 at 14:50

0 Answers0