I'm confused about how to connect to LocalDb from SQL Server 2014 Management Studio. (I also have SQL Standard Edition installed on localhost.)
I have a connection in my ASP.NET application like this:
<add name="DefaultConnection"
connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\BillTest.mdf;Initial Catalog=BillTest;Integrated Security=True"
providerName="System.Data.SqlClient" />
When I go into SSMS 2014 and connect to (LocalDb)\v11.0
I can connect and I see a database like aspnet-BillTest-2015mmddhhmmss
but I can't open it. I get an error like "the database ... is not accessible."
When I connect to (LocalDb)\mssqllocaldb
I can connect, and I see a DB like BillContext
and there are my tables. I verified this is the one the app is connected to, by inserting new rows and seeing them show up in my app.
Can you explain the discrepancy in connect strings:
- how is my ASP.NET application using
(LocalDb)\mssqllocaldb
when the connect string in Web.config is(LocalDb)\v11.0
? What is actually on\v11.0
? - And why does
(LocalDb)\mssqllocaldb
point to a SQL version (12.0.2000) that is neither 11.0 nor my SQL Server 2014 installation (localhost = 12.0.4100.1)? - why is the DB name "BillContext" instead of "BillTest"?