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

Unable to establish a connection to the database using Report Designer

3 Answers 817 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dadan
Top achievements
Rank 1
Dadan asked on 14 Jul 2014, 03:18 AM
Dear Telerik Team,

I have a problem.

"An error has occurred while processing Report 'theReport':
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.
"

I'm
1. Using Telerik Report Q2 2014
2. Designing report using Report Designer (.TRDX)
3. implementing report using ASP.NET v.4 (VB)
4. confuse, it works when i click preview from report designer, but it wont work (saying the above error message) when running it using ASP.NET

the code behind:
Dim uriReportSource As New UriReportSource()
uriReportSource.Uri = Server.MapPath("~/Report/") & "theReport.trdx"
uriReportSource.Parameters.Add(New Telerik.Reporting.Parameter("ID", Request("ID")))
ReportViewer1.ReportSource = uriReportSource


The ConnectionString:
1. in Report Designer/TRDX file, "MyCS"
2. in Web.Config, "MyCS"
3. the same connection string value and the same named connectionString.

Can you help me with this? how can i run my report using asp.net.

Thank you


3 Answers, 1 is accepted

Sort by
0
Accepted
Nasko
Telerik team
answered on 16 Jul 2014, 02:27 PM
Hello Dadan,

The provided code behind and configuration seems to be correct. Thus, it would be best if you could provide us with small runnable sample project exhibiting this behavior, so we can review it locally and advise accordingly.

Additionally, you can try to hardcode the full connection string in the TRDX file instead of using a named connection string and test if the report can be displayed in the viewer with such configuration.

Note that the Telerik Reporting 8.1.14.618 version had an issue with empty design time values for data source parameters, so we recommend you to upgrade to the latest internal build where this issue is fixed and verify if the problematic behavior persists. Please, download the latest internal build from your account and give it a try.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jonathan
Top achievements
Rank 1
answered on 02 Apr 2015, 07:12 PM
I'm receiving a similar issue.

I have an external database server.

Using trdx with an asp.net mvc project.

It appears that preview will work if I give it a design time parameter for the single parameter I'm passing.

However, it won't actually load unless I change the connection string for the datasource (under the <SqlDataSource> node) to be the actual connection string.

While this works, it means that I have to update this node parameter manually every time a change is made, and let others working on the reports either know about it (if they're sufficiently knowledgeable) or tell them to send it over to me every time to change the parameter.

This isn't ideal.

Has there been any progress on this front since July 2014?

0
Nasko
Telerik team
answered on 03 Apr 2015, 11:12 AM
Hello Jonathan,

The issue reported in this forum thread has been fixed in the Q2 2014 SP1 (8.1.14.804) Telerik Reporting release.

In case the issue is still present on your end after upgrading to the latest version, please provide us with a sample report exhibiting it, so we can investigate further.

As for using different connection strings for design-time and run-time we recommend using a named connection string which will be retrieved from the application configuration file. For more information, please refer to the Connection Strings and Configuration Files MSDN article.

Regards,
Nasko
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
General Discussions
Asked by
Dadan
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or