views:

1229

answers:

4

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

+1  A: 

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?

Timothy Khouri
A: 

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..

Aristotle Ucab
+3  A: 

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

A: 

once you add the class just build the solution.you ll find your classes in the list

pallavi