IMPORTANT!
This forum is now archived. Click here for the New Support Forum
How to connect to local DB?
Quote from Jonathon Wyza on February 10, 2018, 11:59 pmHow do you connect to the local DB defined in appsettings.json? I've tried a dozen different approaches in Visual studio to add it as a Data Connection so i could browse the DB, but to no avail. I can't find it as a file and it doesn't show up as a server either. Where is the DB actually being stored?
How do you connect to the local DB defined in appsettings.json? I've tried a dozen different approaches in Visual studio to add it as a Data Connection so i could browse the DB, but to no avail. I can't find it as a file and it doesn't show up as a server either. Where is the DB actually being stored?
Quote from Jonathon Wyza on February 11, 2018, 12:03 amFound it, apparently (local) is the same as (localdb) which is stored in c:\users\<username>\
Found it, apparently (local) is the same as (localdb) which is stored in c:\users\<username>\
Quote from Eben Monney on February 11, 2018, 5:59 am(local)
(local) appears in appsettings.json which is used during production.
It refers to the "default installation of SQL" on the computer/server. Its the same as . and NameOfYourComputer .
To add it as Data Connection and browse the DB you would specify (local) , or . or NameOfYourComputer as the Server name. If your installation of SQL is a named instance then you'll need to include the instance name also as (local)\InstanceName or .\InstanceName of NamdOfYourComputer\InstanceName
(localdb)
localdb appears in appsettings.Development.json which is used during development.
It refers to the light weight "SQL Server Express" installation which is used during development. As you pointed out its data files are saved in c:\users\<username>\
To add it as Data Connection and browse the DB you would specify (localdb)\MSSqlLocalDB as the Server name.
(local)
(local) appears in appsettings.json which is used during production.
It refers to the "default installation of SQL" on the computer/server. Its the same as . and NameOfYourComputer .
To add it as Data Connection and browse the DB you would specify (local) , or . or NameOfYourComputer as the Server name. If your installation of SQL is a named instance then you'll need to include the instance name also as (local)\InstanceName or .\InstanceName of NamdOfYourComputer\InstanceName
(localdb)
localdb appears in appsettings.Development.json which is used during development.
It refers to the light weight "SQL Server Express" installation which is used during development. As you pointed out its data files are saved in c:\users\<username>\
To add it as Data Connection and browse the DB you would specify (localdb)\MSSqlLocalDB as the Server name.
IMPORTANT!
This forum is now archived. Click here for the New Support Forum