I've read the discussion you indicated but I don't have a copy of the webmatrix.data.dll file anywhere on my computer. How, where can I download this file from?
This is tutorial shows you how to add database connectivity in WebMatrix 2 - http://www.asp.net/web-pages/tutorials/introducing-aspnet-web-pages-2/displaying-data
Marked as answer by Dino He - MSFT on Jun 27, 2012 07:16 AM
mpearcy
Member
14 Points
14 Posts
Opening Database in WebMatrix
Jun 23, 2012 07:00 PM|LINK
Why am I getting the following error message when I try to open a database in WebMatrix?
Compiler Error Message: CS0103: The name 'Database' does not exist in the current context
Source Error:
Line 1: @{ var db= Database.Open("Movies"); Line 2: var sqlQ = "SELECT * FROM Favorites"; Line 3: var data = db.Query(sqlQ); }iainamac
Member
18 Points
6 Posts
Re: Opening Database in WebMatrix
Jun 23, 2012 07:13 PM|LINK
Hi,
I also had this issue, posted how I got round this on another thread.
Dino He - MS...
Star
8068 Points
1023 Posts
Microsoft
Re: Opening Database in WebMatrix
Jun 25, 2012 09:52 AM|LINK
Hi
Same discussion here:
http://forums.asp.net/t/1814809.aspx/1/10?Compiler+Error+Message+CS0103+The+name+Database+does+not+exist+in+the+current+context
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
Nu2DaASP.NET
Member
4 Points
3 Posts
Re: Opening Database in WebMatrix
Jun 25, 2012 10:48 PM|LINK
Hi
I'm having the same problem.
I've read the discussion you indicated but I don't have a copy of the webmatrix.data.dll file anywhere on my computer. How, where can I download this file from?
mpearcy
Member
14 Points
14 Posts
Re: Opening Database in WebMatrix
Jun 25, 2012 11:46 PM|LINK
You may have to re-install webmatrix. I have webmatrix 2. I found the dll in C:\Windows\Microsoft.NET\assembly\GAC_MSIL\WebMatrix.Data.
Nu2DaASP.NET
Member
4 Points
3 Posts
Re: Opening Database in WebMatrix
Jun 26, 2012 03:37 AM|LINK
Great! I found it and copied it into the bin folder and that did the trick! Thanks for the location info.
iainamac
Member
18 Points
6 Posts
Re: Opening Database in WebMatrix
Jun 26, 2012 12:21 PM|LINK
This is tutorial shows you how to add database connectivity in WebMatrix 2 - http://www.asp.net/web-pages/tutorials/introducing-aspnet-web-pages-2/displaying-data