Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
roy mm
Yak Posting Veteran
62 Posts |
Posted - 2009-11-30 : 08:20:58
|
change datasource from asp.net -I have a report on my server whice i load into a reportViewer control in asp.net.I'm also sending him parameters with "setParameters" function.Is there a way to change the datasource of the report with parameter or other way?The reason is that we want to move part of the data to history so I want one system that run the regualr reports and another system that run the some reports buy with datasiurce to another table.Thanks. |
|
JCirocco
Constraint Violating Yak Guru
392 Posts |
Posted - 2009-11-30 : 14:31:35
|
A data source specifies the location of the tables. Are you really referring to a Data Set?JohnIt's a small world (but I wouldn't want to paint it) |
|
|
roy mm
Yak Posting Veteran
62 Posts |
Posted - 2009-12-02 : 02:34:45
|
Hi John,I do speak about DataSource.Since we will have two diffrent databases (one for production and one for history) I want to have a parameter that will control to which DB the report will connect.Thanks. |
|
|
JCirocco
Constraint Violating Yak Guru
392 Posts |
Posted - 2009-12-02 : 08:19:30
|
What I should have asked was if the history was just in another table in the same database. Sorry.JohnIt's a small world (but I wouldn't want to paint it) |
|
|
JCirocco
Constraint Violating Yak Guru
392 Posts |
Posted - 2009-12-03 : 16:41:10
|
Just thought of something. Are the column names the same on both tables? There is a way to access a "remote" table, ie a table from a different database. I have seen reference on the T-SQL forumn. Anyway, do that with a UNION in your base SQL? Possibly???JohnIt's a small world (but I wouldn't want to paint it) |
|
|
cvraghu
Posting Yak Master
187 Posts |
Posted - 2009-12-04 : 00:29:43
|
Try something like below. Since i don't have SSRS installed on my box, i'm not sure of exact instructions on how to connect the parameters. But i'm sure you can fin them online.SELECT * FROMCurrentDB.dbo.CurrentTableWHERE @ReportOrQueryParameter = 'Current'Union SELECT * FROMHistoryDB.dbo.historyTableWHERE @ReportOrQueryParameter = 'History'Edit: Forgot to mention that its a single datasource. But we are connecting to the 2 dbs in query. |
|
|
behrman
Yak Posting Veteran
76 Posts |
|
|
|
|