Reputation: 34717
I just downloaded MVC and I am going through a tutorial. Everything goes fine until I try to declare a DataContext object.
My dbml is named db.dbml (tried another on named test.dbml) and when I try this:
public dbDataContext db = new dbDataContext();
I get:
The type or namespace name 'dbDataContext' could not be found ...
Am I missing something? In webforms this is all I had to do, and in the tutorial that is all that is shown. I downloaded the newest MVC today...
Thank you.
**EDIT: I am using VS2008 SP1
Upvotes: 2
Views: 3401
Reputation: 1
once you add the class just build the solution.you ll find your classes in the list
Upvotes: -1
Reputation:
This is a sp1 bug if you are using partial classes, see the following and work-arounds: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361577
Upvotes: 3
Reputation: 74
try to add context to the namespace {ProjectName}.Models...
because the models are stored in the models namespace.. try to check if you have include the namespace in your current context..
Upvotes: 0
Reputation: 31885
A few quick questiosn: Is the name of your data context "dbDataContext"?... also, is it in a namespace? (do you have that namespace referenced).
Another question... is this a runtime error, or a compiletime error?
Upvotes: 1