Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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..
XML
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

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 link[^] for more information.


All the best.
--Amit
 
Share this answer
 
v2
Comments
Abhai Oza 12-Sep-12 2:49am    
Sorry Not Solve this error.
DbContextMeans???
_Amy 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:
MSDN : DbContext Class[^]
Entity Framework - Second Level Caching with DbContext[^]
Abhai Oza 12-Sep-12 5:18am    
Sry..I have not understand DBContext ??
_Amy 12-Sep-12 5:20am    
Abhai Oza 12-Sep-12 6:28am    
Just give how to create DBContext Class in MVC
Or You have Create any Example in MVC ??
DBContext is in the System.Data.Entity[^] namespace, add reference to EntityFramework.dll assambly. If it is not installed use nuget, or the standalone installer: http://nuget.org/packages/EntityFramework[^]
 
Share this answer
 
using System.Data.Linq;

u can use Ctrl + .
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900