Click here to Skip to main content
15,900,675 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using Entity Framework in my project but i am getting error like this

The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

in app.config file
XML
<configuration>
  <connectionStrings>
    <add name="NorthwindEntities" connectionString='metadata=res://*/NorthwinEntities.csdl|res://*/NorthwinEntities.ssdl|res://*/NorthwinEntities.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=TRIOM;initial catalog=Northwind;integrated security=True;multipleactiveresultsets=True&quot;' providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>


please help me

thank you.
Posted
Comments
Abey Thomas 16-Jan-12 22:54pm    
Can you please specify the code you are using to connect to the Entity Data Model?

1 solution

I saw the tag as asp.net, hence I am assuming you are facing this problem from an asp.net web application. If that is the case, the App.config you are referring above must be the auto generated file with the project where the EDMX file resides.
I suggest you copy the whole <connectionstrings> node and place it in your web.config.
 
Share this answer
 
v2
Comments
sreekanth12 16-Jan-12 23:12pm    
Thank you Abey Thomas but i am getting error. when i copied connection string in web.config
Unable to load the specified metadata resource.
Abey Thomas 16-Jan-12 23:26pm    
Is your edmx file in a different project?
If that is the case, do add a reference of it to your web project and recompile the whole project It should work.
If the above doesnt work still, then you will have to change the connection string in web.config manually
Replace res://*/ with res//NameOfDLLoftheProjectwhereEDMXlies.dll//NorthwinEntities.csdl
i.e wherever you see "*" in your connection string, replace it with the name of the assembly of the EDMX project.
sreekanth12 17-Jan-12 2:09am    
Thank you Abey Thomas its working fine.
Abey Thomas 17-Jan-12 2:31am    
Hi Sree you are welcome.. plz do mark the solution as "answer" if it worked for you. Thanks!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900