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

Feed Parameter to Connection String

1 Answer 70 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Dana Cobb
Top achievements
Rank 1
Iron
Dana Cobb asked on 06 Mar 2015, 04:04 PM
I wish to change the database the connection string is pointed to based upon a Reporting parameter. Is that possible? Or do I have to use the ChangeConnectionString class I found on another thread.

Ideally, I'd like to be able to have a parameter called @dbid and have the connectionstring be:

<ConnectionString Name="DynamicConnection" ConnectionString="Data Source=servername;Initial Catalog=@dbid;Integrated Security=True"
                            ProviderName="System.Data.SqlClient" />

All within the designer. Is this possible?

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 11 Mar 2015, 10:42 AM
Hello Dana Cobb,

The ConnectionString property of the SqlDataSource component does not support expressions or report parameters. Thus, you will need to use the approach described in the Changing the connection string dynamically according to runtime data KB article.

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.

 
Tags
Report Designer (standalone)
Asked by
Dana Cobb
Top achievements
Rank 1
Iron
Answers by
Nasko
Telerik team
Share this question
or