Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have a class library project and a WPF Project.
I am trying to write code inside class library to connect to a wpf project using entity framework. I get error "Configuration system failed to initialize"

below is the code in App.Config

XML
<connectionStrings>
  <add name="dbQuickPhonebookContainer"
       connectionString="metadata=.\dBase.dbQuickPhonebook.csdl|.\dBase.dbQuickPhonebook.csdl|.\dBase.dbQuickPhonebook.msl;provider=System.Data.SqlClient; provider connection string="Data Source=localhost;attachdbfilename=|DataDirectory|\dbQuickPhonebook.edmx;Initial Catalog=dbQuickPhonebook;Integrated Security=True;MultipleActiveResultSets=False""
      providerName="System.Data.EntityClient" />
</connectionStrings>


below is the code inside my class

C#
public class BusinessLayer 
    {
       
        string connString;

        public BusinessLayer()
        {
           
connString = ConfigurationManager.ConnectionStrings      ["dbQuickPhonebookContainer"].ConnectionString;
        }


    }


Please help me write code inside the class to get the name of connection string.
Posted
Comments
[no name] 10-Aug-12 12:59pm    
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/41cfc8e2-c7f4-462d-9a43-e751500deb0a/
Santhosh Kumar Jayaraman 11-Aug-12 0:01am    
Is that your server name correct?

1 solution

Hi did you check out the link Wes gave you, and did it help:
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/41cfc8e2-c7f4-462d-9a43-e751500deb0a/[^]

If not Im going to give you the link to the Microsoft documentation that contains a hole lot of articles and videos on the subject:
http://msdn.microsoft.com/en-us/netframework/first-steps-with-wcf.aspx[^]

So good luck to you :)
 
Share this answer
 
Comments
Wonde Tadesse 10-Aug-12 22:08pm    
5+
Kenneth Haugland 10-Aug-12 22:16pm    
Thanks :)
Volynsky Alex 11-Aug-12 3:49am    
Yes 5+
Kenneth Haugland 11-Aug-12 4:21am    
Thanks, but you forgot to vote :)
Volynsky Alex 11-Aug-12 4:29am    
You are welcome

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