I ran into this issue when I was going through the w3schools stuff on ASP.NET.
Basically, the above answers are correct: you need the assembly (DLL) WebMatrix.Data, but the commenters don't tell you how to fix the problem. Here's how:
First, copy the file WebMatrix.Data.dll into your site's /bin folder.
If you're not sure where to get it, you can have WebMatrix create a new project using a database-enabled template -- say, Bakery -- and get it out of that project's bin folder. Or you can search your hard drive for the file. I have a copy in C:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies
.
Then, in your ASP.NET page, import the assembly.
This is kind of a bad idea for a site you're going to have to maintain for a long time, but for the purposes of this demo, you just need to add @using WebMatrix.Data;
to the top of your products page. It should end up looking something like this:
@using WebMatrix.Data;
@{
var db = Database.Open("SmallBakery");
var selectQueryString = "SELECT * FROM Product ORDER BY Name";
}
Now it should recognize the symbol "Database", and all will be well.