Entity connection string in Asp.net MVC

0
<connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;Initial Catalog=aspnet-OnlineShoppingStore-20181119035803;Integrated Security=Ture; AttachDbFilename=|DataDirectory|\aspnet-OnlineShoppingStore-20181119035803.mdf" providerName="System.Data.SqlClient" />
    <add name="dbMyOnlineShoppingEntities" connectionString="metadata=res://*/DAL.Model1.csdl|res://*/DAL.Model1.ssdl|res://*/DAL.Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.;initial catalog=dbMyOnlineShopping;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

Throwing Exceptions

System.Data.Entity.Core.EntityException
  HResult=0x80131501
  Message=The underlying provider failed on Open.
  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>

Inner Exception 1: SqlException: 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. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Inner Exception 2: Win32Exception: The system cannot find the file specified Throwing Exceptions System.Data.Entity.Core.EntityException HResult=0x80131501 Message=The underlying provider failed on Open. Source= StackTrace:

Inner Exception 1: SqlException: 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. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Inner Exception 2: Win32Exception: The system cannot find the file specified

c#
sql-server
asp.net-mvc
asked on Stack Overflow Apr 17, 2021 by Arbab ali

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0