Mukesh Kumar Tiwari

Mukesh Kumar Tiwari

  • NA
  • 980
  • 252.5k

No connection string named 'SMSEntities' could be found .

Apr 25 2015 7:02 AM
Hi frnds...
 
i have configured a wpf application and make BAL and DAl and WpfApp three project in my solutions . I have Added Entity Framework in DAL and class file in BAl. when i am going to run the application it shows the error "No connection string named 'SMSEntities' could be found in the application config file."
there is a app.config file in my DAL.
 
When i get this error then i have added an app.config file in  WpfApp project also, And add the connection string in that file. But still i am getting the same error when i am going to insert the record in database 
 
DAL(App.config content)
 
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="SMSEntities" connectionString="metadata=res://*/SchoolEntity.csdl|res://*/SchoolEntity.ssdl|res://*/SchoolEntity.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=TIWARI-PC\SQLEXPRESS;initial catalog=SMS;user id=sa;password=00;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
</configuration>
 
Please help me out...
 
 
 
 

Answers (3)