BT

.NET Framework 4 Now Supports LocalDB

by Abel Avram on Oct 29, 2011 |

Microsoft has added LocalDB support in .NET Framework 4. LocalDB is a free developer edition of SQL Server “Denali” meant to provide most of the server’s API but without management overhead.

Microsoft has released an update to the .NET runtime, Update 4.0.2, including a number of improvements related to SQL Server connectivity such as AlwaysOn and LocalDB support in SQLClient. Developers can now access LocalDB instances from Visual Studio, helping them develop and test programs against a simple and easy to maintain SQL database.

Microsoft has made available SQL Server Express, a free and limited edition of their database server, which can be used to test the server and applications using it. But SQL Express has had some installation and administration overhead. Also, keeping up with other SQL Server editions meant making it larger and even harder to work with in small development environments such as one provided by a laptop. So Microsoft decided to introduce a new dedicated version shortly called LocalDB in SQL Server 2012 codename “Denali”.

To access LocalDB the developer needs to provide the connection string "Data Source=(localdb)\v11.0;Integrated Security=true" and the data provider will start a LocalDB instance as a child process and will connect to it. Also, LocalDB supports attaching database files during the connection process, allowing access to the database files directly without going through the database server. Other features are:

  • LocalDB runs from the same sqlservr.exe like SQL Express or other editions
  • Clients use same T-SQL to connect to LocalDB
  • Applications use the same providers to connect to LocalDB
  • LocalDB does not create any database services
  • LocalDB process are started/stopped automatically

While LocalDB is similar to SQL Server Compact in simplicity and easiness of use, there are some differences: SQL Compact runs as an in-process DLL while LocalDB runs in a separate process, Compact offers only limited RDBMS functionality while LocalDB has a much richer functionality set including Stored Procedures, Geometry and Geography data types, and others, and Compact has a very small memory footprint, its binaries amounting to 4MB while LocalDB’s binaries are 140 MB.

LocalDB is not meant to replace SQL Express, but to offer developers the possibility to develop apps with as little overhead as possible. Microsoft will continue to provide the free SQL Server Express editions for users interested in running small evaluation projects with a 10GB database size limit.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT