Database selection at runtime for a crystal report

I would like to thank this community for the enormous help to develop my skills. Thanks.

I have 2 databases and a single report form and a crystal reportviewer.
The User can select the database which he want to work
(Each of them belongs to different warehouse)
So he can select and make dc, invoice, and associated work for the particular database.
I have a dataclass it difines which database selected and which data should be retrieved
using a login screen which contains a database selection combo. All goes well.

I am also created a report format in crystal report. and it also have parameters.
If it is a single database report i can easily connect the data thru typed dataset.

But I have 2 databases, how can i get the report source for the report
My problem is how to retrieve the data for the particular database to that crystal reports.

Please let me give some idea about getting the particular database data for the report.
Thanks in advance.....

hi john,
I am very sorry for my late answer.
Your view is absolutely correct.
When the application startsup the user has signed in and after that they have selected the database (i.e: 10462.mdb, 61973.mdb etc). After that I have a connected thru a connection class using the current database. Its working fine. But I don't know how to use the same method in crystal reports.

Then when it's time to print the crystal report, you just use that variable to determine which datasource to set for the report. There is a thread here, discussing setting the datasource programatically, that also references some KB articles at Crystal's website.

Disclaimer:I don't use Crystal Reports, so I don't have that code on-hand

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...