Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
No connection string named 'SMSEntities' could be found .
Mukesh Kumar Tiwari
Apr 25 2015 7:02 AM
4.4k
Reply
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="data source=TIWARI-PC\SQLEXPRESS;initial catalog=SMS;user id=sa;password=00;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
</configuration>
Please help me out...
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
How I can create connection with SQL database in C# WPF?
Updating WPF Datagrid on changing ItemsSource