Creating a SQL Server CE 4 Database in WebMatrix
Currently, both SQL Server CE 4 and WebMatrix are in beta, so use these tools at your own risk. I'm not responsible for rebuilding my work laptop, so I can plow on with impunity. Also, Mircosoft's recursive naming process (emphasis on "curse") strikes again. This is not the same WebMatrix from the VS 2003/.NET 1.1 days. This a completely new WPF application. Apparently naming the product "WebMatrix 2010" would deviate from the naming scheme employed with Visual Studio, Office, SQL Server, Exchange, BizTalk, .
The easiest way to work with SQL Server CE 4 beta is with WebMatrix, which is available at http://www.microsoft.com/web/webmatrix/. Installing WebMatrix beta will also install IIS Express beta and SQL Server CE 4 beta. The tools for SSMS 2008 and VS 2010 have not been released yet.
Starting WebMatrix brings you to a wizard screen. For this exercise, we're going to choose Site From Template.
All we need for this demo is an Empty Site. Name the site whatever you want.
Our site is created, and we're taken to the website maintenance page. From here, click the Databases button in the lower left corner.
Here, click the Add a Database to your site link, or the New Database button in the ribbon.
A database is created with the same name as our website.
To add a table, select the database and click the New Table button in the ribbon. The table designer is similar to SSMS. When you're done designing the table, the save button is a little tiny icon in the upper left corner of the title bar (it would be nice if this were on the ribbon with the New Table button).
Give the table a good name.
Once the table is saved, the Data button on the ribbon is activated. Clicking this takes you to a data entry screen very similar to Access. Data can be entered directly into the table by typing in the appropriate columns. Data are committed when you press Enter, and you can delete a row with the Delete Row ribbon button.
There you have it-quick and easy databases!