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

Unable to establish a connection to the database

10 Answers 3990 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nagadurgababu ankem
Top achievements
Rank 1
Nagadurgababu ankem asked on 03 Dec 2010, 11:34 PM
Hi  Telerik
I am creating the report with attaching database connection and tables by taking the class library , and i am saw the report on preview tab with database records(up to this working fine)

Now i am take the visual studio project , and attach the above report to ReportViewer and run the project then it shows following error
-----------------------------------------------
An error has occurred while processing Report '':
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.
-------------------------------------------------

10 Answers, 1 is accepted

Sort by
-1
Steve
Telerik team
answered on 06 Dec 2010, 05:46 PM
Hi Nagadurgababu,

As the message clearly states, you should copy the connectionString from the report class library to the config file of your actual application (web.config for web site/app, app.config for windows forms).

Best wishes,
Steve
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
Yusuf
Top achievements
Rank 1
answered on 07 Apr 2011, 01:26 PM
Hi Steve,

I'm getting the same error as Nagadurgababu.

At design time I have bound data to my Table (using the Table Wizard) via an SQLDataSource, which i have created previously. It renders fine in the Preview tab. However when i try to bind a DataTable (with the same schema as the one coming through my SQLDataSource) programmatically to the DataSource property (actually it is: ReportSource.DataSource) of my report then i get the exact same error as mentioned (by Nagadurgababu).

This is the first Telerik report I'm building, so i might be missing a trick or two. I have searched and read wide to try and get to the bottom of this problem, but haven't come up with a solution yet.

So, your guidance would be much appreciated.

I'm using Reporting Q1 2011

Thanks IA
Yusuf
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 11 Apr 2011, 08:26 AM
So Yusuf, did you copy the connectionString from the class library where your reports reside to the configuration file of your actual application as Steve explained? Also the ReportSource Property is specific to the subreport item and not the Table, so I am not sure whether you're doing things correctly.

Cheers!
0
Yusuf
Top achievements
Rank 1
answered on 11 Apr 2011, 09:06 AM
Thanks for your reply Massimiliano. The trick was the ReportSource property in order to gain access to the items of the subreport, viz. the table in my case.

Cheers
Yusuf
0
Sonali
Top achievements
Rank 1
answered on 21 Jun 2012, 04:54 AM
Hello telerik ,
I am also getting the same error when using telerik reports.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 have check the connection string in web config file of project and in class library also.They both are same. 
 
0
Steve
Telerik team
answered on 21 Jun 2012, 06:39 AM
Hi Sonali,

Something must be different, note that the report is looking for the name of the connection, so even if the connectionString is correct, if the name differs, it would not find it. Also note that this scenario is only valid if you have used a saved connection string as connectionString for your report data source, otherwise the connectionString would be hardcoded in the report itself, in the InitializeComponent method. So if that connectionString is not valid for your SQL Server you should change it accordingly.

Greetings,
Steve
the Telerik team

FREE WEBINAR ON THE NEW REPORT DESIGNER! Join us on Friday, June 29 at 10:00 AM for a comprehensive demo of the official version of the standalone Report Designer and find out how easy it is to empower your users with creating, editing and sharing ad-hoc reports. The webinar will go through a real-world scenario of creating reports, embedding them in your application(s), and distributing them within your organization. We will also cover the newly added support for sub-reports, navigation actions (such as drill-down and drill-through), and report sources. Register here and bring your questions with you. We’ll try to address them during the webinar! You may even win a Telerik Ultimate Collection license! Register today >>

0
Marek
Top achievements
Rank 1
answered on 21 Feb 2014, 02:47 PM
I had the same error. In my case visual designer was showing different connection string name then it was set in code so I modified connection string name in telerik designer class manually and that worked. Sometimes visual designer hangs when number of fields is large - 200 - 300.
0
Keith Rowe
Top achievements
Rank 1
answered on 25 Jun 2014, 10:54 PM
I followed the solution closely.  Still the same problem.

Would love to see updated Telerik TV episodes.  The ones I am watching are from 2009.
0
Stef
Telerik team
answered on 26 Jun 2014, 02:33 PM
Hi Keith,

You can follow the steps illustrated in the SqlDataSource Wizard article to set your SqlDataSource component.

In your support ticket #833478 you can find additional information on your concrete connectivity problem with the SqlDataSource component.

Regards,
Stef
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
Gunjan
Top achievements
Rank 1
Iron
answered on 12 Sep 2023, 12:39 PM

Got same error , unable to get connection string....   
After adding MySql.Data and MySqlConnector Packages  from NuGet the error removed and Report Application work properly 

Hope this will help ..!

 

Regards, 

Gunjan

Tags
General Discussions
Asked by
Nagadurgababu ankem
Top achievements
Rank 1
Answers by
Steve
Telerik team
Yusuf
Top achievements
Rank 1
Massimiliano Bassili
Top achievements
Rank 1
Sonali
Top achievements
Rank 1
Marek
Top achievements
Rank 1
Keith Rowe
Top achievements
Rank 1
Stef
Telerik team
Gunjan
Top achievements
Rank 1
Iron
Share this question
or