I'm currently using this connection string to attach to my database that I created in Visual Studio:
Data Source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|Database1.mdf;User Instance=true
I'm trying to host the site with IIS so I can mess around with response headers but I'm getting the problem described here: SQL Server Express connection string for Entity Framework Code First
I'm trying to find what database name to specify but not having any luck. I tried Initial Catalog=Database1
but that gave me this error:
Cannot create file 'D:\docs\Visual Studio 2010\Projects\QuickHomePage\QuickHomePage\App_Data\Database1.mdf' because it already exists. Change the file path or the file name, and retry the operation.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
I'm just trying to attach to Database1.mdf
. Why is it giving errors about trying to create it? One comment suggested attaching the .mdf file to another database instance to see what's inside it.
Would that require running SQL Server Management studio? Every time I try to connect to Server Type Database Engine and the local machine it gives a connection error.