Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User Instance of SqlLocalDb

Tags:

localdb

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\UserName\Desktop\DB\TestDB3.mdf 

Exception is

The user instance login flag is not allowed when connecting to a user instance of SQL Server. The connection will be closed.

like image 683
Siddharood Avatar asked Dec 27 '12 11:12

Siddharood


People also ask

What is LocalDB instance?

An instance of SQL Server Express LocalDB is an instance created by a user for their use. Any user on the computer can create a database using an instance of LocalDB, store files under their user profile, and run the process under their credentials. By default, access to the instance of LocalDB is limited to its owner.


1 Answers

LocalDB instances are all "User Instances", and there's no need to specify User Instance=true in your connection string, in fact it is not even supported (as you can see). Just remove this part and it's going to work fine.

like image 112
Krzysztof Kozielczyk Avatar answered Sep 17 '22 15:09

Krzysztof Kozielczyk