|
From: yfat on 14 Dec 2005 12:47 Hi, I want to connect to several databases, is it possible to pass the connection string as a parameter and change connection to the database dynamically ? Thanks.
From: Wayne Snyder on 14 Dec 2005 17:25 Try this ="data source=" &Parameters!ServerName.Value & ";initial catalog=AdventureWorks Of course you can change anything in the connection string... In your case, you'd provide the catalog instead of the servername... -- Wayne Snyder MCDBA, SQL Server MVP Mariner, Charlotte, NC I support the Professional Association for SQL Server ( PASS) and it''s community of SQL Professionals. "yfat" wrote: > Hi, > I want to connect to several databases, is it possible to pass the > connection string as a parameter and change connection to the database > dynamically ? > > Thanks.
From: Mike Collins on 14 Dec 2005 17:44 I believe you want the SetDataSourceContents method. You can find an explanation of it in BOL. "yfat" wrote: > Hi, > I want to connect to several databases, is it possible to pass the > connection string as a parameter and change connection to the database > dynamically ? > > Thanks.
From: yfat on 15 Dec 2005 04:23 Ok, I tried to create a dynamic data source with two parameters - the server name and the database name like this : ="data source=" &Parameters!ServerName.Value & ";initial catalog=" &Parameters!DBName.Value but when I try to continue with that data source i get this error about trying to connect the data base : "A connection cannot be made to the database. Set and check the connection string." sice the connection is a dynamic one, I cannot know at the design time the user and the password for the data base. "Wayne Snyder" wrote: > Try this > > ="data source=" &Parameters!ServerName.Value & ";initial > catalog=AdventureWorks > > > Of course you can change anything in the connection string... In your case, > you'd provide the catalog instead of the servername... > -- > Wayne Snyder MCDBA, SQL Server MVP > Mariner, Charlotte, NC > > I support the Professional Association for SQL Server ( PASS) and it''s > community of SQL Professionals. > > > "yfat" wrote: > > > Hi, > > I want to connect to several databases, is it possible to pass the > > connection string as a parameter and change connection to the database > > dynamically ? > > > > Thanks.
From: yfat on 15 Dec 2005 05:13 I just saw that the connection string on Reporting Services version 1.0 cannot be based on expressions, Is it possible on the next version ? "yfat" wrote: > Ok, I tried to create a dynamic data source with two parameters - the server > name and the database name like this : > > ="data source=" &Parameters!ServerName.Value & ";initial > catalog=" &Parameters!DBName.Value > > but when I try to continue with that data source i get this error about > trying to connect the data base : > "A connection cannot be made to the database. Set and check the connection > string." > > sice the connection is a dynamic one, I cannot know at the design time the > user and the password for the data base. > > "Wayne Snyder" wrote: > > > Try this > > > > ="data source=" &Parameters!ServerName.Value & ";initial > > catalog=AdventureWorks > > > > > > Of course you can change anything in the connection string... In your case, > > you'd provide the catalog instead of the servername... > > -- > > Wayne Snyder MCDBA, SQL Server MVP > > Mariner, Charlotte, NC > > > > I support the Professional Association for SQL Server ( PASS) and it''s > > community of SQL Professionals. > > > > > > "yfat" wrote: > > > > > Hi, > > > I want to connect to several databases, is it possible to pass the > > > connection string as a parameter and change connection to the database > > > dynamically ? > > > > > > Thanks.
|
Pages: 1 Prev: Matrix columns - Conditional Formatting - Column Number Next: Changing Report's Datasource |