Home

<DBContext> connectionString setting not found in config file

edited June 2012
This is a newbie question, i am able to set up my data model in the LINQPad Connection window, but when i hit the 'Test' button i get the following message:

---------------------------
LINQPad
---------------------------
The database connection is valid, but the following exception

was thrown when trying to instantiate the custom ObjectContext:



The type initializer for 'DBContext' threw an exception.



Inner Exception: DBContext connectionString setting not found in config file
---------------------------
OK
---------------------------

I have checked in both a configuration file for LINQPad and a configuration file for my custom assembly and they now both have a connectionString with proper values, what config file is this message referring to?

This is what i have in the configuration files:


<connectionStrings>
<add name="DBContext" connectionString="metadata=res://*/DBContext.csdl|res://*/DBContext.ssdl|res://*/DBContext.msl;provider=System.Data.SqlClient;provider connection string="data source=(local)\sql2008;initial catalog=DBDev;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient"/>
</connectionStrings>


Thanks,

Daniel Miranda

Comments

  • So now that i have another question i saw this one again and thought of pointing out that the error i was having back then was because the data context had code in it referring to the config file, however the config file LINQPad.config but LINQPad came with a LINQPad.exe.config, so all i did was rename this file to LINQPad.config and it worked...
Sign In or Register to comment.