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

Problem with datasource

1 Answer 250 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
PAGCA
Top achievements
Rank 1
PAGCA asked on 04 Oct 2011, 06:38 PM
I have designed my first report. Data connection was created via the wizard and works fine in the preview mode. However when trying to launch the report via a webviewer on an aspx page, it is unable to connect to the database. The error says:

An error has occurred while processing Report 'RTARevenues':
Unable to establish a connection to the database. Please, verify that your connection string is valid. In case you use a named connection string from the application configuration file, make sure the name is correct and the connection string settings are present in the configuration file of your application.
------------- InnerException -------------
Format of the initialization string does not conform to specification starting at index 0.

I tried copying the connection string used elsewhere in the project into the app.config file and using it for the report but that did not work either.
What do I need to do to get this to work?
Thanks

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 06 Oct 2011, 09:39 AM
Hello Don,

SqlDataSource Wizard searches for existing database connections in Server Explorer and in the configuration file of the current project. For example, if you have a separate class library project for your reports, the wizard searches for connection strings only in the App.config file of that project. If you have your connection string specified in the Web.config file of another project, you need to copy it to the App.config file of the report class library as well, otherwise the wizard cannot discover it. This is done for a reason: since a solution may contain many different projects, each of them with its own configuration file, it is unknown which one might contain the correct connection string for your report, so we simply pick the configuration file of the current project where the report is located. Moreover this behavior allows you to use two different databases for development and for production. For example, the database used for development and testing purposes might be a local one, while the actual production database might be situated on a dedicated database server.

The following forum thread contains more information on the topic.

Greetings,
Steve
the Telerik team

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

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