This is a migrated thread and some comments may be shown as answers.

ConfigurationErrorsException

1 Answer 148 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eric Krauska
Top achievements
Rank 1
Eric Krauska asked on 04 Oct 2011, 08:24 PM
Error:
A connection string was referenced by name but could not be resolved through the web.config.

I am running into this on my reporting project.  In my web.config file I have:
<connectionStrings configSource="sql.config"/>

And in the sql.config I have:
<add name="BarcodeEntityDiagrams" connectionString="data source=ERICWIN7-PC\SQLEXPRESS;initial catalog=Barcode;integrated security=True"
  providerName="System.Data.SqlClient" />

I create a brand new report, add a OpenAccessDataSource using the wizard and point the connection string to BarcodeEntityDiagrams.  When I go to the Preview tab of the report I get the error:
An error has occurred while processing Report 'VendorDetails':
Exception has been thrown by the target of an invocation.
------------- InnerException -------------
System.Configuration.ConfigurationErrorsException: A connection string was referenced by name 'Barcode' but could not be resolved through the web.config or the executables app.config file.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.connect(ConnectionString connectionString, IDictionary driverProps)
at OpenAccessRuntime.Relational.sql.SqlDriver.InitializeFor(ConnectionString connectionString, Boolean noConnect, PropertySet props, Driver& driver, Connection& conn)
at OpenAccessRuntime.Relational.RelationalStorageManagerFactory..ctor(StorageManagerFactoryBuilder b)
at OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createSmfForURL()
------------- InnerException -------------
A connection string was referenced by name 'Barcode' but could not be resolved through the web.config or the executables app.config file

Again, this is a brand new report using the report wizard. No custom code at all.  Any suggestions? I'm using Reporting 5.1.11.713



1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 06 Oct 2011, 01:26 PM
Hello Eric,

Currently there is no support for referencing external configuration fields. If you want to use Preview, you would have to copy the entire connectionString to the config file of the project where the reports reside (app.config if class library and web.config if web application). If you can live without Preview, then you do not have to do anything as it would work properly when running your actual application.

Best wishes,
Steve
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
General Discussions
Asked by
Eric Krauska
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or