Questions tagged [localdb]
LocalDB is a lightweight deployment option for SQL Server Express Edition with the same features but with a simple installation. To support scenarios where multiple users of the computer need to connect to a single instance of LocalDB, LocalDB supports instance sharing but does not support sharing among multiple computers.
localdb
1,030
questions
272
votes
14
answers
331k
views
How to connect to LocalDB in Visual Studio Server Explorer?
I can't believe I couldn't find a working solution to this after an hour of searching. I'm following this article on Entity Framework 6.0 which gives a simple walk-through on Code First. I created the ...
182
votes
19
answers
303k
views
ASP.NET 4.5 has not been registered on the Web server
In my Win 7 development machine, and in order to use SQL Express instance instead of the localDB installed by default. I unchecked "Use IIS Express" in my MVC 4 project properties page (Web tab), then ...
158
votes
4
answers
69k
views
"Server" vs "Data Source" in connection string
I'm new to SqlServer, right now I have SqlLocalDb installed to work locally. Good, but I can see two connection strings typically and both works:
Data Source=(localdb)\v11.0;Integrated Security=true;
...
142
votes
12
answers
62k
views
EF5: Cannot attach the file ‘{0}' as database '{1}'
I'm encountering the exact issue as described here (read section "Cannot Attach to Deleted MDF File"), but the solution to the problem is not told there...
In short the issue is that after deleting ...
129
votes
13
answers
213k
views
How to connect to LocalDb
I installed LocalDb using the SqlLocalDb.msi package and I can connect to it using SSMS using the server name (LocalDb)\v11.0. So far so good. The problem is that when I try to connect to it via a ....
73
votes
1
answer
77k
views
SQL Server (localdb)\v11.0 explained
I'm following Code First to an Existing Database tutorial and noticed that it suggested to connect to (localdb)\v11.0 in learning purposes. I've tried to connect to it using my SQL Management Studio ...
70
votes
8
answers
209k
views
What is the connection string for localdb for version 11
I'm trying to do the Code First Walkthrough of the entity framework ( http://blogs.msdn.com/b/adonet/archive/2011/09/28/ef-4-2-code-first-walkthrough.aspx ).
I have the latest SQL Server Express and ...
67
votes
1
answer
24k
views
LocalDB SQL Server 2014 Express creates 2 instances (localdb)\ProjectsV12 & (localdb)\MSSQLLocalDB?
I'm using SQL Server 2014 Express and the LocalDB option, and I have the following in my SQL Server object explorer pane in Visual Studio 2013...
So what is the difference between (localdb)\...
62
votes
5
answers
20k
views
How to set up LocalDb for unit tests in Visual Studio 2012 and Entity Framework 5
We have a Visual Studio 2012 ASP.NET MVC project using Entity Framework 5.
There are some unit tests that depend on a database. Setting up the app.config file in the test project to use a central SQL ...
61
votes
3
answers
39k
views
Is there a difference between SQL Server Express (2012) and LocalDB?
In his excellent and popular comparision chart, ErikEJ draws a distinction between SQL Server Express 2012, and SQL Server 2012 LocalDB. However, I can't find such a distinction anywhere else in the ...
57
votes
3
answers
85k
views
Cannot connect to (LocalDB)\MSSQLLocalDB -> Login failed for user 'User-PC\User'
I am getting an error, While I am trying to connect (LocalDB)\MSSQLLocalDB through SQL Server management studio. I also tried to login with default database as master the error is same.
Here is the ...
55
votes
4
answers
102k
views
How to install localdb separately?
If I have to work with localdb, do we need to install it separately?
I have SQL Server 2008 R2 Management Studio installed, SQL Server 2012 installed, .net 4.0.2 update installed. But I don't see ...
55
votes
6
answers
56k
views
How do I upgrade SQL Server localDB to a newer version?
Is it possible to upgrade SqlServer localDB from 2012 to 2014?
We currently use version 11 from SQL Server 2012. I need to upgrade to version 12 from SQL Server 2014.
I would like to be able to ...
54
votes
8
answers
127k
views
How to add LocalDB to Visual Studio 2015 Community's SQL Server Object Explorer?
Problem
I don't understand how to make LocalDB show up in the SQL Server Object Explorer. On some VMs, it shows up automatically, on some other VMs, it doesn't. Still, after googling for hours, I don'...
52
votes
3
answers
95k
views
SQL Server Express localdb.msi offline installer
I am not able to install using the online installer. Can anyone point me to where I can find the offline installer? I tried searching with Google gut with no luck.
This is similar but not an offline ...
52
votes
2
answers
50k
views
LocalDB deployment on client PC
I am very intrigued by this new version of SQL Server Express.
It's not clear (to me) what a setup program should do to deploy an application that use a LocalDB.
Is it required to install SQL ...
46
votes
9
answers
48k
views
How to transfer ASP.NET MVC Database from LocalDb to SQL Server?
I created a new ASP.NET MVC 5 project in Visual Studio 2013 (Express for Web) and by default, the project uses LocalDb as its database, but how do you transfer or migrate the database to SQL Server?
...
46
votes
1
answer
29k
views
SQL Server Express vs express localdb
I am having quite a few problems understanding differences between regular SQL Server Express and express Localdb.
Before you go ahead and tag a previous post about this question, I've went through ...
44
votes
4
answers
55k
views
How to manually create a mdf file for localdb to use?
I'm setting up some unit tests for testing work done with a database. I would like to use localdb v11 but first I need to create the database. How exactly do I do this?
simply connecting to (localdb)...
39
votes
3
answers
19k
views
Is it normal to use LocalDb in production?
I know that using LocalDb is very good and easy for developement, I wonder if it's good idea to use it in production when I host websites on IIS server?
I'm asking because I wonder if it won't have ...
39
votes
5
answers
21k
views
How to delete (localdb) database if the file is gone
If I run SQL Server Management Studio, and tell it to connect to (localdb)\v11.0, it knows about every database I've ever used, despite the fact that most of the the database files are long gone.
If ...
30
votes
3
answers
31k
views
How to change the default connection to a server in Visual studio 2012 SQL Project?
In visual studio 2012 sqlproj, the default connection button always connect to the (localdb)\Projects by default. How do I change that? Every time I need to disconnect and connect again to change the ...
30
votes
1
answer
11k
views
Purpose of ProjectsV13 LocalDB instance
According to this answer, SQL Server Data Tools uses a private LocalDB instance ProjectsV13, which you're not supposed to use for your own applications. Instead, you should use MSSQLLocalDB or your ...
29
votes
2
answers
18k
views
User Instance of SqlLocalDb
I am getting this Exception When I am trying to access database from C#.
My Connection String is
Data Source=(localdb)\v11.0;integrated security=true;User Instance = true;AttachDbFileName=C:\Users\...
29
votes
6
answers
13k
views
How do I change "Database default locations" for LocalDB in SQL Server Management Studio?
Connect to LocalDB in SSMS
Open Server Properties -> Database Settings
Change Data/Log/Backup locations -> click OK
When I click OK I get this error:
Found some blogpost and changed this in regedit ...
28
votes
8
answers
63k
views
I can't get a Sql Server localdb connection to work on a computer that does not have SqlServer Express installed
I have a C# console application written using Visual Studio 2012. In the application I am using a Sql Server localdb connection to a database to store information. This is working fine on several ...
27
votes
4
answers
29k
views
Connecting to SQL Server LocalDB using JDBC
Is it possible to connect to a SQL Server LocalDB using JDBC? It appears that (as of Dec 2011) it was not possible.
Do you know of a workaround or change in status?
27
votes
5
answers
32k
views
Why can't I connect to a SQL Server 2012 LocalDB shared instance?
I'm trying to set up a SQL Server 2012 LocalDB (RTM, x64) shared instance on my Windows 7 x64 machine and I can't seem to connect to the shared instance. I'm using an Administrator command prompt for ...
26
votes
9
answers
23k
views
How do I copy SQL Server 2012 database to localdb instance?
I'm looking to copy a SQL Server 2012 Standard database to my localdb instance. I've tried the wizard which complains that localdb isn't a SQL Server 2005 or later express instance. I also did a ...
25
votes
2
answers
13k
views
How to prevent SQL Server LocalDB auto shutdown?
I'm using SQL Server 2012 Express LocalDB. Instances seem to stop automatically after 10 minutes if there is no activity on them. Is there a clean way to keep an instance running forever?
24
votes
5
answers
29k
views
How do I connect to an older sql database using LocalDb in VS 2012?
I am trying to construct a connection string to a 2008 SQL Express database file in VS 2012. I am getting an error dialog:
This database file is not compatible with the current instance of SQL
...
23
votes
9
answers
44k
views
How to install LocalDB 2016 along with Visual Studio 2017?
After installing Visual Studio 2017 with the SQL Server Data tools feature checked, I noticed LocalDB was not installed. How can I add SQL Server LocalDB 2016 to my Visual Studio 2017 installation? ...
22
votes
3
answers
9k
views
Windows API call "RegGetValueW" returned error code: 0
I am getting Windows API Call Error Code : 0
I have installed SSMS 2018 and was trying to find out if I have any other versions installed. For that I ran sqllocaldb versions in CMD but got the ...
22
votes
4
answers
12k
views
SQL2012 LocalDB: how to check in c# if it is currently installed?
How to check in c# code if LocalDB currently installed? also, how to check if SQLNCLI11 presents in system?
22
votes
1
answer
27k
views
confusion about SQL Server Express and localdb
I need to deploy a WCF service with a database on client machines. I am confused about SQL Server Express. I need to verify all of the following.
When attaching database files in the App_Data ...
20
votes
1
answer
58k
views
Unable to connect to localDB in VS2012 – "A network-related or instance-specific error occurred while establishing a connection to SQL Server..."
This is strange as I'm able to connect to localDB through SSMS 2008R2 with the same connection string ("Data Source=(LocalDB)\v11.0;Integrated Security=true")
Only C# code is unable to connect, I ...
19
votes
5
answers
40k
views
How to deploy ASP.NET MVC 4 application using localDB to local IIS on Windows 7?
When I try to run my ASP.NET MVC 4 application using Local IIS on Windows 7 with Visual Studio 2013. I run into the following error when the application tries to connect to localDB\v11.0
Server ...
19
votes
1
answer
21k
views
Create user and assign permission to user in LocalDB in Visual Studio
Can someone please tell me how I can create a user with a password and grant it owner permission to a database that I created in LocalDB in Visual Studio.
It creates a user with no login but I need ...
18
votes
2
answers
15k
views
How to RESEED LocalDB Table using Entity Framework?
Is There any way to RESEED a LocalDB Table using EF?
I'd prefer not to use this SQL Command :
DBCC CHECKIDENT('TableName', RESEED, 0)
FYI : I'm using EF 6.1.
Thanks alot.
18
votes
1
answer
8k
views
What is the best way to attach existing database to sql localdb?
Context
I'm working on a desktop app which must be able to run in case of connection loss with the distant sql server : a SQL Server Express (I know...) 2012. I'm working on Visual Studio Express ...
17
votes
3
answers
13k
views
Sql local database cannot be opened
I recently installed VS2015 Update 2 on two different PC, one at home and one at work, with the same installer file.
Now if I open a project with Sql LocalDB on my own PC, I obtain this error:
...
16
votes
4
answers
8k
views
ClickOnce Prerequisites: where is SQL Server Express 2014 LocalDB?
I am creating a clickonce installer for my wpf application from within Visual Studio 2013 Community edition. This application uses a localdb. It works fine on the target machines if I manually install ...
16
votes
4
answers
22k
views
IIS connecting to LocalDB
Is there any way so IIS could connect to LocalDB without using the NT SERVICE\NETWORK SERVICE user account.
This account has not suitable permissions. I'm looking use some other default account or ...
16
votes
2
answers
6k
views
Using LocalDB with Service Fabric
I have an Actor that upon receiving a request from a WebAPI project, the Actor queries a table using Entity Framework 6.
using (var context = new MetadataContext())
{
var userStorageAccountId = ...
15
votes
5
answers
16k
views
MSSQLLOCALDB databases aren't listed
I used the ASP.NET 5 Preview Templates in Visual Studio 2015 to create an ASP.NET 5 site. According to the config.json file, there's a database in (localdb)\mssqllocaldb.
I want to move that database ...
15
votes
3
answers
10k
views
Recreate and Reseed LocalDb Before Each Unit Test
I'm attempting to write unit/integration tests for my ASP.NET Web API project and struggling to run each test in isolation. Allow me to explain.
I have a *.testsettings file with deployment settings ...
15
votes
1
answer
17k
views
Change default location of LocalDb
I am programming with EF5-code first and want to use LocalDb. How can I change the default location of LocalDb database file? Default location is %USERPROFILE% directory according to http://blogs.msdn....
15
votes
5
answers
18k
views
Using SQL LocalDB in a Windows Service
I have a very small test application in which I'm trying to install a Windows Service and create a LocalDB database during the install process, then connect to that LocalDB database when the Windows ...
15
votes
5
answers
5k
views
Using auto-configured localdb for unit testing; how do I clean up?
I've configured an .mdf file along with a localdb connection string for use in unit tests, like this:
<connectionStrings>
<add name="TestData" providerName="System.Data.SqlClient" ...
14
votes
4
answers
31k
views
The specified LocalDb instance does not exist
I've been using a localDB named 'Projects' for a while now. This is the same database that is created by default ASP.NET MVC 5 project. However, suddenly it stopped and I'm not able to connect to it ...