Back to list
Views:   0
Replies:  0
Archived
,
Reply 1
Dennis,

That's an easy one to get confused about, but also and easy one to answer.

When the Entity Framework designer is created and you make a connection to your database in order to add tables to the designer, it saves the connection string to the App.Config file in your data objects project.  It is only used by the EF designer for you to manage the connection with your database.

The connection string in the Hosting layer IS the one that is used for data access by the application. 

As you have shown in the code you present, the DataObjectFactory class in the DataObjects project looks for an appSettings.config file with a setting called "ConnectionStringName".  It's this name that will point to one of the available connectionstrings in the "connectionStrings" section of that web.config file.

So the bottom line is that the connection string from the web.config file in the WCF hosting layer is the one that is used.

I hope this answers your question.

King Wilder
King Wilder, Apr 15, 2012
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas