So I’ve been starting to play with LINQ to get ready to start using the Entity Framework (I am hoping to start using it for projects at work as I want to move away from Access Databases). Anyway, I found out about LocalDB which allows you to use a MS-SQL database without actually installing the SQL engine. The neat thing about this is that you get to use the full features of MS-SQL databases without any limitations. Check out more about LocalDB here. Anyhow, I am going to start using this on both my development machine at work, my main workstation at home and my laptop. Below are the steps I took to configure this for future reference:
- Make sure you have Visual Studio 2010, Service Pack 1.
- Download Update 4.0.2 for the .NET Framework 4.0 and install it on the workstation/laptop.
- Download the SqlLocalDB.msi file (x86 or x64 depending on your machine)
- After installing the SqlLocalDB.msi file open up Visual Studio 2010 and add a new connection
- Use the default SQL Client and for database use: (localdb)\v11.0
- Attach the database you want to open up, test connection and if all goes well, you should get a successful connection.
<connectionStrings> <add name="DB_Name" connectionString="Data Source=(localdb)\v11.0; AttachDbFilename=[Path_To_DB]\DB_Name.mdf; Initial Catalog=DB_Name;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings>
Note: For more information on setting this up on a workstation, check out this article on msdn.