Mukesh Kumar Tiwari

Mukesh Kumar Tiwari

  • 1.1k
  • 993
  • 187.1k

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"?>
<!-- For more information on Entity Framework configuration, visit -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<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" />
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
Please help me out...

Brought to you by:

Answers (3)