Hello

I want to write a simple application. Simple as in it is easy to
describe but i can't figure it out.

This application that i want to create has a report viewer that shows
the contents of the tables in the database as reports. I have a
database with two tables in it: TableA and TableB. The GUI of the
application has two button plus the reportviewer. One of the buttons
is called A and the other one B. When i click the button A i want the
report viewer to display the contents of TableA. When i click the
button B i want ... you guessed it... the reportviewer to display the
contents of TableB as a report.

The problem i have is that i cannot seem to assign a new data source
to the reportviewer. When you add a reportviewer to your app in visual
studio 2008 you have to give it a datasource. I do this but then i
can't change this data source later in the application. I have created
separate rdlc files for the two reports and i am trying to give the
reportviewer a new data source but it seems to be "stuck" with the
data source that it got when i created it. I have googled this a lot
and all i can see is that i need a DataSet that contains the info from
the tables and i have to use this dataset as a datasource but it's not
working. Does anybody have some sample code that does this? Or knows
where i can find it? I have looked but could not find it. A thourough
explanation would also be nice. Thanks in advance.

Cheers

Reply via email to