Solved

Asp.net mvc entity issue

Posted on 2016-11-21
6
37 Views
Last Modified: 2017-01-17
Hi Guys,

I have asp.net mvc application and I added ADO entity from my test database then I changed the connection string to the production database. The database in the production and test environment are identical and everything was working just fine so far.

Today I changed the connection string back to the test environment and all of a sudden I got this error:

"error 0019: Each type name in a schema must be unique. Type name 'RMSmasterHQModel.Cashier' was already "

work around:
I recreate the entity and still the same issue.

Please, help.
0
Comment
Question by:Moti Mashiah
  • 4
  • 2
6 Comments
 
LVL 28

Accepted Solution

by:
Pawan Kumar earned 500 total points
ID: 41896970
Seems like your dll is not getting updated.
go to Bin Folder - DELETE dll and the pdb file for that project and the build again.

After that try again.

Also do you have 2 projects with EDMX ?
0
 
LVL 1

Author Comment

by:Moti Mashiah
ID: 41897828
YEs I have to projects with edmx.

Please see the example:

Untitled.png
0
 
LVL 1

Author Comment

by:Moti Mashiah
ID: 41897864
the problem I have is with the hq.edmx that actually comes from the same sql server and created in both projects.
so in the main project asp.net mvc I have it created twice I think.

<add name="RMSmasterDBEntities" connectionString="metadata=res://*/Rmsdb.csdl|res://*/Rmsdb.ssdl|res://*/Rmsdb.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=srv-db-01;initial catalog=RMSmasterDB;persist security info=True;user id=sa;password=*******;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    <add name="RMSmasterHQEntities" connectionString="metadata=res://*/Hq.csdl|res://*/Hq.ssdl|res://*/Hq.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=srv-db-01;initial catalog=RMSmasterHQ;user id=sa;password=a******;multipleactiveresultsets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    <add name="ALThompsonCRMEntities" connectionString="metadata=res://*/ALT.csdl|res://*/ALT.ssdl|res://*/ALT.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=srv-db-01;initial catalog=ALThompsonCRM;user id=sa;password=*******;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    <add name="ALThompsonCRM2Entitiessav" connectionString="metadata=res://*/ALTsav.csdl|res://*/ALTsav.ssdl|res://*/ALTsav.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=srv-sav-rms1;initial catalog=ALThompsonCRM2;persist security info=True;user id=sa;password=******;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    <add name="RMSmasterDB2Entitiessav" connectionString="metadata=res://*/Rmssav.csdl|res://*/Rmssav.ssdl|res://*/Rmssav.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=srv-sav-rms1;initial catalog=RMSmasterDB2;persist security info=True;user id=sa;password=*******;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Open in new window

0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 1

Author Comment

by:Moti Mashiah
ID: 41897918
Problem had been fixed. I just deleted the hq.edmx from the other project.
0
 
LVL 1

Author Closing Comment

by:Moti Mashiah
ID: 41897920
Thank you for leading me to the solution.
0
 
LVL 28

Expert Comment

by:Pawan Kumar
ID: 41898341
Welcome !!
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question