mardi 26 avril 2016

Adding EntityClient into Connection String SqlClient

I am trying to add a Entity Framework project with object relational mapping (ORM) into my standard SQL Server Project (MVC ASP.Net).

I think the problem is in the Connection String in the Web.config file:

<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-Project2-20160209033141.mdf;Initial Catalog=aspnet-Project2-20160209033141;Integrated Security=True" providerName="System.Data.SqlClient" />
<add name="BlogEntities" connectionString="metadata=http://res*/Entities.BlogContext.csdl|res*/Entities.BlogContext.ssdl|res*/Entities.BlogContext.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\aspnet-Project2-20160209033141.mdf;integrated security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

DefaultConnection is the main project im working with and BlogEntities is what i'm trying to add. When i run the project the BlogEntities it seems to work fine, but im having trouble running the Default Database, as It wont let me log into user accounts and other tasks that have worked before. Error Example->

Is there an easier way to add this into my project without disrupting the current database? Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire