Use Visual Studio Server Explorer to Add New or Existing SQL Server CE Database

SQL CE is a free, embedded, lightweight  database engine that enables easy database storage. This does not required any installation and runs in memory. Visual Studio 2010 SP1 Came up with nice tooling support for SQL Server CE. We can add a SQL CE Data base using Add New Item option from Solution Explorer Context Menu. But In this tip I am going to talk about how you can add a New SQL CE Database or Add a Existing one from Server Explorer. 

This will also help you to connect with some existing created SQL CE Databases as well. Below are the steps which you needs to follow.

First open the Server Explorer from View > Server Explorer ( Ctrl + W , L )

Then Click on “Connect To Data Base Icon

image

This will brings up the “Add Connection Dialog” but default Data Source is set to “Microsoft SQL Server ( SqlClient) . Click on “Change..”

image

In “Change Data Source” dialog, select “Microsoft SQL Server Compact 4.0”  as Data Source and by it will have only single Data Provider “.NET Framework Data Provider for Microsoft SQL Server Compact 4.0

image

on click of “Ok” it will navigate back to “Add Connection Window”.

There you can “Create a New SQL CE DB” or can browse  existing “SQL CE DB

image

Click on “Browse” will launch the Open File dialog box from where you have to specify the existing file names .  If you want to create a new open click on “Create”  button, it will launch Create New SQL CE Compact Data Base Window.

image

Provide file name and required information and click on OK, you will find the SQL CE Database on the Server Explorer.

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

One Comment to “Use Visual Studio Server Explorer to Add New or Existing SQL Server CE Database”

  1. Eugh, seriously, where did you learn how to write. I know to each his (her) own but I can’t follow you writing style :s I am sure you will delete this but I just thought you should know. Monica

Comments are closed.