Solved

Asp.net mvc entity issue

Posted on 2016-11-21
6
32 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 24

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 24

Expert Comment

by:Pawan Kumar
ID: 41898341
Welcome !!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now