About LocalDB database in Visual Studio IDE.


In this article we will see what is LocalDB database and what is the use of this database. LocalDB is a Light weight database with minimum set of files required to create the database. It is part of Visual Studio 2012 and later versions of Visual Studio. It needs .NET Framework 4.0.2 version installed.

In this article we will see what is LocalDB database and what is the use of this database.

What is LocalDB
1.LocalDB is a Light weight database with minimum set of files required to create the database. That is it is a LightWeight version of SQLExpress.
2.It is part of Visual Studio 2012 and later versions of Visual Studio. It needs .NET Framework 4.0.2 version installed. You can update the Visual Studio 2012 with this patch from the below link:
http://www.microsoft.com/en-us/download/details.aspx?id=27756
3.The LocalDB instance runs as a user process whereas SQL Express runs as a service on the computer.
4.It requires a different connection string than the SQL Server connection string. The connection looks like shown below:
"Server=(localdb)\\v11.0;Integrated Security=true;"
Here two slashes(\\) are required because '\v' is a special character.
v11.0 is the name of your LocalDb instance which is the default public instance
5.LocalDB stores the system databases under the AppData directory.
6. It is very fast.
7.It can be used to create and work with database from the code.
8. It can be embedded into the application that needs local databases.
9.If its not installed in Visual Studio. You can go here and install it:
msdn.microsoft.com/en-us/evalcenter/hh230763.aspx
or
microsoft.com/betaexperience/pd/SQLEXPNOCTAV2/enus/default.aspx

How to connect to LocalDB in Visual Studio Server Explorer?

1.Open command prompt
2.Run SqlLocalDB.exe start v11.0
above command will start the LocalDB instance
3.Run SqlLocalDB.exe info v11.0
Above command gives the information about the LocalDB such as Name, Version, Owner, State,Last start time,Instance pipe name.
4.Copy the Instance pipe name that starts with np:\...
5.In Visual Studio select TOOLS > Connect to Database...
6.For Server Name enter (localdb)\v11.0. If it didn't work, use the Instance pipe name that we have copied earlier.
7.Select the database on next dropdown list
8.Click OK


Article by Vaishali Jain
Miss. Jain Microsoft Certified Technology Specialist in .Net(Windows and Web Based application development)

Follow Vaishali Jain or read 127 articles authored by Vaishali Jain

Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: