c# - Connecting MVC to existing table -


I'm having trouble trying to add MVC to database in an existing table, when I load the page So it displays me error:

Since the database has been created, the model supporting the 'chartstarsprocedier DBCText' reference has changed. Consider using code first migration to update database ().

I'm feeling this because my class (model) does not match the column in the database, I've got my connection to the web. ConfiG and I have given it the name of the class that comes from DBCTtext.

I am not asking for this solution, I am wondering why I will get this error message.

Thanks for the boys, I finally managed to solve the problem, I had to add this line:

< P> P>
  database. Set Inchializer & lt; Chartered Procederer BCTXT (Zero);  

To:

  Public class MvcApplication: System.Web.HttpApplication {secure void Application_Start () {AreaRegistration.RegisterAllAreas (); // This line worked here! Database.SetInitializer & LT; ChartStoredProcedureDBContext & gt; (Zero); WebApiConfig.Register (GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters (GlobalFilters.Filters); RouteConfig.RegisterRoutes (RouteTable.Routes); BundleConfig.RegisterBundles (BundleTable.Bundles); AuthConfig.RegisterAuth (); }}  

which is the Global.assx file and then I have to redirect it to my table name that I used to:

  [table ( "Tbl_myTable")] Public square chartstarsprocessed  

this solved my problem.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -