ASP, PERL, CGI, C und alles andere Wolle ma net so sein. Obwohl Perl, ASP, C und TCL zu den minderwertigen Internet-Skriptsprachen zählen, dürfen ab sofort hierzu auch Fragen gestellt werden. ;) |
 |

30-06-2016, 09:56
|
jatloui
Registrierter Benutzer
|
|
Registriert seit: Jun 2016
Beiträge: 2
|
|
Asphostportal Code First Migration from ASP.NET MVC 5
I have created a ASP.NET MVC5 project and I am hosting the website in asphostportal. I am facing a problem when doing code first migration. When I add Enable-Migrations, Add-Migration Initial create and Update-Database from Nuget, Only ASP.Net Identity table and two database context table gets created in asphostportal Database and a new copy of all the table will be created in my local SQLEXPRESS server. I have tried to recreate the migration Several times but changes. Eg: I have database table A,B,C,D,E,F and ASP.NET Identity table 1,2,3,4. In asphostportal after running Migration 1,2,3,4,E,F table get created and In local .SQLEXPRESS A,B,,C,D,E,F gets created. At present no matter how many times I delete the migration folder, drop both tables from asphostportal and Local SQLExpress server the result is the same.
When I run Enable-Migrations I get the Error
Code:
More than one context type was found in the assembly 'Hotel'. To enable migrations for 'Hotel.Models.DatabaseContext', use Enable-Migrations -ContextTypeName Hotel.Models.DatabaseContext. To enable migrations for 'Hotel.Models.ApplicationDbContext', use Enable-Migrations -ContextTypeName Hotel.Models.ApplicationDbContext.
So I select
Code:
Enable-Migrations -ContextTypeName Hotel.Models.DatabaseContext
and tried with ApplicationdbContext, but will get an error when created the data for the table (A,B,C,D,E,F).
How can I move all my table to asphostportal database
Geändert von jatloui (30-06-2016 um 10:02 Uhr)
Grund: asp.net, sql, asp.net mvc
|

30-06-2016, 09:59
|
jatloui
Registrierter Benutzer
|
|
Registriert seit: Jun 2016
Beiträge: 2
|
|
Asphostportal Code First Migration from ASP.NET MVC 5
I have created a ASP.NET MVC5 project and I am hosting the website in asphostportal. I am facing a problem when doing code first migration. When I add Enable-Migrations, Add-Migration Initial create and Update-Database from Nuget, Only ASP.Net Identity table and two database context table gets created in asphostportal Database and a new copy of all the table will be created in my local SQLEXPRESS server. I have tried to recreate the migration Several times but changes. Eg: I have database table A,B,C,D,E,F and ASP.NET Identity table 1,2,3,4. In asphostportal after running Migration 1,2,3,4,E,F table get created and In local .SQLEXPRESS A,B,,C,D,E,F gets created. At present no matter how many times I delete the migration folder, drop both tables from asphostportal and Local SQLExpress server the result is the same.
When I run Enable-Migrations I get the Error
Code:
More than one context type was found in the assembly 'Hotel'. To enable migrations for 'Hotel.Models.DatabaseContext', use Enable-Migrations -ContextTypeName Hotel.Models.DatabaseContext. To enable migrations for 'Hotel.Models.ApplicationDbContext', use Enable-Migrations -ContextTypeName Hotel.Models.ApplicationDbContext.
So I select
Code:
Enable-Migrations -ContextTypeName Hotel.Models.DatabaseContext
and tried with ApplicationdbContext, but will get an error when created the data for the table (A,B,C,D,E,F).
How can I move all my table to asphostportal database[/QUOTE]
|
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
|
|
Themen-Optionen |
|
Thema bewerten |
|
Forumregeln
|
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
HTML-Code ist aus.
|
|
|
|
PHP News
|