Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can using 2 databases in one dataset?

Status
Not open for further replies.

jepe666

Programmer
Apr 17, 2008
36
ID
I using syntax like this :
=Switch(RTrim(Parameters!companyID.Value)=”01”,"Data Source=ServerName;Initial Catalog=SC","Data Source=ServerName;Initial Catalog=BI")
I put it to dataset->edit->data source->connection string..
When I deploy, no error, but when i preview i got error "error during processing of the connectstring expression of datasource".
So I change the syntax like :
=IIf(Parameters!companyID.Value="01","Data Source=ServerName;Initial Catalog=SC","Data Source=ServerName;Initial Catalog=BI")
But I got the same message..So what can I do?Can I using 2 databases in one dataset?

Thanks for Advance!!
 
AFAIK, it is possible to set the datasource / connection string at run time as the result of a formula as you have. I have done it using an IIF statement as you have but I did need to meddle about a bit with the TYPE of dataset that RS thinks it is returning. In the dataset definition options, you can choose "Text", Stored Proc" or "Query" and I think you need to have this set to TEXT for it to be able to execute the formula at runtime

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top