in Education by
I try to create database from entity framework code first follow with this tutorial http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part4-cs but I use SQL Server 2005 instead when SQLExpress but When I execute solution don't have anything create. What wrong with my code This is my code. Movie.cs public class Movie { public int ID { get; set; } public string Title { get; set; } public DateTime ReleaseDate { get; set; } public string Genre { get; set; } public decimal Price { get; set; } } public class MovieDBContext : DbContext { public DbSet Movies { get; set; } } And this is my connection string in web.config What Wrong with my code? Why database wasn't created. thank you every one to help me. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The database is not created until it is used for the first time. You must do any of following to trigger database creation: Create instance of your context and retrieve or persist any data Create instance of your context and call context.Database.CreateIfNotExists() Create instance of your context and call context.Database.Initialize(false) Create instance of your context and call context.Database.Create()

Related questions

0 votes
    Does anyone know how to add another folder to the asset pipeline in Rails 3.1? I'd like to serve app/assets/ ... an asset path, in your application.rb file: config.assets.paths...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Actually I'm developing a live streaming app for WP7 and I'm facing a problem. I'm trying to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I have a scenario that I want to implement in Laravel. I have already implemented this kind of approach ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 26, 2022 in Education by JackTerrance
0 votes
    I have a scenario that I want to implement in Laravel. I have already implemented this kind of approach ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have a scenario that I want to implement in Laravel. I have already implemented this kind of approach ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    What is Database First Approach in MVC using Entity Framework?...
asked Apr 5, 2021 in Education by JackTerrance
0 votes
    In order to create the proper queries I need to be able to run a query against the same datasource ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    Debugging some finance-related SQL code found a strange issue with numeric(24,8) mathematics precision. Running ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    This one will take some explaining. What I've done is create a specific custom message queue in SQL ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    Question No.1: What do you understand about container tag and empty tag, give example? Question No.2: What do ... all the attributes? Select the correct answer from above options...
asked Nov 29, 2021 in Education by JackTerrance
0 votes
    I have an incoming json object that represents the data pulled from a database structure. I would like to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 24, 2022 in Education by JackTerrance
0 votes
    I'm using EF code first. By convention, I have added a foreign key and a reference to the foreign ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I want to test my Entities that are built using Entity Framework. My concern is that using Entity Framework ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am receiving SOAP requests from a client that uses the Axis 1.4 libraries. The requests have the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 30, 2022 in Education by JackTerrance
0 votes
    I am receiving SOAP requests from a client that uses the Axis 1.4 libraries. The requests have the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 29, 2022 in Education by JackTerrance
...