I ran into this problem when I was browsing w3schools stuff on ASP.NET.
Basically, the answers above are correct: you need a WebMatrix.Data assembly (DLL), but commentators do not tell you how to fix this problem. Here's how:
First, copy the WebMatrix.Data.dll file to your / bin folder in your site.
If you don’t know where to get it, you can create WebMatrix a new project using a template with a database support - say, Bakery - and pull it out of this project bin folder. Or you can search a file on your hard drive. I have a copy in C:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies .
Then, on the ASP.NET page, import the assembly.
This is kind of a bad idea for a site that you will need 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 product page. It should look something like this:
@using WebMatrix.Data; @{ var db = Database.Open("SmallBakery"); var selectQueryString = "SELECT * FROM Product ORDER BY Name"; }
Now he should recognize the symbol "Database", and everything will be fine.
Matthew lowe
source share