Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MVC
Hi..
i have learn MVC use this link
http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/cs/adding-a-model[^]
but i have proble in DBContext code.Error:DbContext not be found..
public class MovieDBContext : DbContext
   {
       public DbSet<Movie> Movies { get; set; }
   }
 
Give me help or other way to use databinding in MVC.Withoout DBContext.
 
Thankx....
Posted 11-Sep-12 20:15pm
Achal Oza1.4K
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

using System.Data.Linq;
 
u can use Ctrl + .
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
In the case of class files, you need to add Linq referance(System.Data.Linq). Follow the steps:
Steps:
1. Right click on the project --> Add Reference
2. Go to .Net tab
3. Select System.Data.Linq and click ok.
4. Use Linq namespace using System.Data.Linq;

Refer this ^] for more information.
 

All the best.
--Amit
  Permalink  
v2
Comments
Achal Oza at 12-Sep-12 2:49am
   
Sorry Not Solve this error.
DbContextMeans???
_Amy at 12-Sep-12 2:56am
   
It's represents a combination of the Unit-Of-Work and Repository patterns and enables you to query a database and group together changes that will then be written back to the store as a unit.
Refer the links:
^]
Entity Framework - Second Level Caching with DbContext[^]
Achal Oza at 12-Sep-12 5:18am
   
Sry..I have not understand DBContext ??
_Amy at 12-Sep-12 5:20am
   
Achal Oza at 12-Sep-12 6:28am
   
Just give how to create DBContext Class in MVC
Or You have Create any Example in MVC ??
_Amy at 12-Sep-12 6:34am
   
Achal Oza at 13-Sep-12 1:39am
   
Please ...Step by Step .
How to create DBContext Class and Use In Controllers in MVC.
And I have download Last link Project but Error on this Project.
Error is :-
"Error 1 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. C:\Documents and Settings\achal.prajapati\Desktop\OpenLibrary\OpenLibrary\Web.config 31
"
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

DBContext is in the ^] namespace, add reference to EntityFramework.dll assambly. If it is not installed use nuget, or the standalone installer: http://nuget.org/packages/EntityFramework[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 530
1 mhegazy94 460
2 Ravi Bhavnani 230
3 Kornfeld Eliyahu Peter 185
4 Shemeemsha RA 160
0 Sergey Alexandrovich Kryukov 7,205
1 OriginalGriff 6,801
2 CPallini 5,350
3 George Jonsson 3,644
4 Gihan Liyanage 2,797


Advertise | Privacy | Mobile
Web01 | 2.8.140922.1 | Last Updated 22 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100