Question

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

Was it helpful?

Solution

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

OTHER TIPS

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?

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top