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

Unable to establish connection in report testing

1 Answer 173 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chuck Harrington
Top achievements
Rank 1
Chuck Harrington asked on 10 Feb 2011, 06:02 PM
I need to test some extensive code behind logic for a report I am developing, so I added a Windows form project to my solution that contains the class library with the report in it.  I added the necessary reference to my code library and set the window form as the start up form.  I added the Report Viewer and the correct reference to my report in the Report property.  So far no problem.  When I attempt to generate the report however, I get the following message "An error has occurred while processing Report 'report object name'  Unable to establish connection to the database." etc.  I have verified my database connection.  I have no problem previewing the report from my class library.  It generates just fine but with invalid data, thus the need to single step through my logic.  What am I missing in setting up this testing environment.  thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 11 Feb 2011, 05:41 PM
Hi Chuck,

The error message is correct - the report cannot find the connectionString. If the reports are defined in a class library, always remember to copy the corresponding connection string entries from the class library's config file to the application's config file. Otherwise at runtime when the application's config file is respected the Settings object will not be able to find such connection strings and will return the default value from its metadata. More information is available in the Using connectionStrings from configuration file KB article.

Greetings,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
Tags
General Discussions
Asked by
Chuck Harrington
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or