Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to connect a SQL Database to an MVC4 project using Entity Framework.

I have a database: Astronomy.mdf which is located in the mdb project.

The connection string was found at:
HTML
https://connectionstrings.com/sql-server/

In web.config:
XML
<connectionStrings>
  <add name="testContext" connectionString="Server=.\SQLExpress;AttachDbFilename=C:\folder\mdb\mdb\App_Data\Astronomy.mdf;Database=Astronomy;Trusted_Connection=Yes;" />
</connectionStrings>
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900