I actually deleted the previous connection and the models from my project and added them again. However, now I can't connect to the database again. I verified the connection strings in all the web.config and app.config, but they are the same.
Web.config
:
<add name="AuthenticationAppEntities"
connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="Data Source=MyPC;Initial Catalog=AuthenticationApp;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework""
providerName="System.Data.EntityClient" />
Another web.config
:
<add name="AuthenticationAppEntities"
connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="Data Source=MyPC;Initial Catalog=AuthenticationApp;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework""
providerName="System.Data.EntityClient" />
App.config
:
<add name="AuthenticationAppEntities"
connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="Data Source=MyPC;Initial Catalog=AuthenticationApp;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework""
providerName="System.Data.EntityClient" />
I have no idea what could be wrong there. Any help?
When I enable Common Language Runtime Exception, I get this error :
'(db.Table).Local' threw an exception of type 'System.InvalidOperationException'