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

2010 Report Viewer not dislpaying data

4 Answers 200 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 20 Apr 2010, 02:12 PM
I recently upgraded to 2010 and am having issues with the new SQLDatasource. When I try to use a reportviewer in my web project, I get the error below. Previously in 2009 when I referenced the DLL, it brought across the data connections. With the new SQLDatasource, it does not seem to bring the conncetion string with it.

How do I seet the data connection in the 2010 version?


Unable to connect to database. Please verify that your connection string is valid; in case you use a 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.

at Telerik.Reporting.Processing.Data.SqlQueryProvider.CreateConnection()
at Telerik.Reporting.Processing.Data.SqlDataEnumerable.SqlDataEnumerator.CreateReader()
at Telerik.Reporting.Processing.Data.SqlDataEnumerable.SqlDataEnumerator.MoveNext()
at Telerik.Reporting.Processing.Data.ResultSet.SeedData(IEnumerable`1 rawData)
at Telerik.Reporting.Processing.Data.ResultSet.Fill(IEnumerable`1 data)
at Telerik.Reporting.Processing.Data.SqlQueryProvider.Execute(MultidimensionalQuery query)
at Telerik.Reporting.Processing.ParametersManager`1.CalculateAvailableValues(T parameter, ReportParameterAvailableValues definition, Object& data)
at Telerik.Reporting.Processing.ParametersManager`1.Calculate(T parameter, IDictionary`2 parameterValues)
at Telerik.Reporting.Processing.ParametersManager`1.GetParameters(IDictionary`2 parameterValues)
at Telerik.ReportViewer.WebForms.ParametersPage.OnPreLoad(EventArgs e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

4 Answers, 1 is accepted

Sort by
0
Philip
Top achievements
Rank 1
answered on 20 Apr 2010, 09:40 PM

When I reference the DLL, it imports the DLL, an XML and a pbd file. I can not seem to find where the connection string should be. I assume it should be in the XML file, but it appears to be empty. The XML file below is the file associated with the dll.

Where do I check the connection string for the dll class?


<?

 

xml version="1.0"?>

 

<

 

doc>

 

<

 

assembly>

 

<

 

name>

 

ModReports2010

</

 

name>

 

</

 

assembly>

 

<

 

members>

 

</

 

members>

 

</

 

doc>

 

0
Steve
Telerik team
answered on 21 Apr 2010, 08:21 AM
Hi Philip,

We believe the error message is pretty clear: "In case you use a connection string from the application configuration file (i.e. the class library), make sure the name is correct and the same connection string settings are present in the configuration file of your application as well."

In other words if you have saved a connectionString in your class library and it is e.g.:

<connectionStrings>
        <add name="PhilipHunnicuttConnectionString"
            connectionString="Server=(local);Database=AdventureWorks;Integrated Security=SSPI;"
            providerName="System.Data.SqlClient" />
    </connectionStrings>

you should copy that connection string to your application configuration file (web.config for a web app or app.config for windows forms app).
This behavior has always been this way and the only way the class library dll "would bring across" the connectionString is if you have explicitly set Copy to Output Directory property to Copy Always (not recommended).

All the best,
Steve
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Philip
Top achievements
Rank 1
answered on 21 Apr 2010, 01:05 PM
Thanks for that and  yes, the error message is quite clear once you know how to do it.

For others who may not fully understand like me, I had to go back to my project from where the dll originated and go to the bin/release or bin/debug folder and open the projectname.dll.config file. This file contains the connection strings. Copy those connection strings into the web config file in your asp project.

The problem I had was, I did not know where to go look for the connectionstrings. It is not obvious, to me anyway, that they are contained in the projectname.dll.config file in the originating project.
0
Emmanuel
Top achievements
Rank 1
answered on 07 Sep 2011, 10:30 PM
Thanks for clarifying that Philip.  I was having the same problem.
Tags
General Discussions
Asked by
Philip
Top achievements
Rank 1
Answers by
Philip
Top achievements
Rank 1
Steve
Telerik team
Emmanuel
Top achievements
Rank 1
Share this question
or