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

Problem when publishing

3 Answers 236 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
T
Top achievements
Rank 1
T asked on 16 Feb 2012, 05:37 PM
Hello,
I'm using newest Telerik Reporting and VS2010. Also I have lib for telerik reports, and WWW separately.
In lib project I have app.config file with named connection string.
In WWW I have web.config file with same name as in lib project.
1) When I'm in designer - it works fine
2) When I run application on my pc with dev server - it works fine.
3) When I publish and move to production server it says:
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.
4) When I copy built application (without publishing) the error is the same

1) I don't use any tranforms, etc when publishing.
2) I use the same connection string name with BLL layer and it works fine.
3) I logged values:
sqlDataSourceForReport.ConnectionString
and
System.Configuration.ConnectionStrings

sqlDataSourceForReport.ConnectionString exist in list of connectionString

Please let me know:
- how to log (debug) exceptions like this
- what can I log to have more info about error (what Telerik was looking for, where, what was found, what missing).
- can IIS settig may have influence to this error?

Best regards, Tomasz

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 17 Feb 2012, 09:52 AM
Hello Tomasz,

According to your description, the problem is with the deployed project, so check what differs on the server compared to your local project that runs fine. Generally there are two things to consider:
  1. Always modify the application settings at design time through its editor and never change it through the config file because the changes won't be recorded in the settings metadata;
  2. If the reports are defined in a class library and you add settings for this 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.

Regards,
Steve
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Piotr
Top achievements
Rank 1
answered on 17 Feb 2012, 11:41 AM

0
T
Top achievements
Rank 1
answered on 17 Feb 2012, 12:12 PM
Thank you for your suggestion.

I found the issue. The problem was that I was connecting to MySQL database using MySql.Data.dll (connector for .NET). Although file was in bin folder, Telerik report did not use it. After installing connector by msi package and probably registering file in GAC, everything works fine.

Thank you for your support. Please consider adding more precise info about error.

All the best, Tomasz
Tags
General Discussions
Asked by
T
Top achievements
Rank 1
Answers by
Steve
Telerik team
Piotr
Top achievements
Rank 1
T
Top achievements
Rank 1
Share this question
or