Changing design time dataset/connection at runtime?

OK. New question. Here's my scenario. I'm working on a project that will allow users to view/print/export reports from their database. The database that they'll be using is installed at their location (not mine). The program I'm attempting to write will allow them to install on any computers they want and the be able to view reports. So, they have the database at their office (with a static IP, of course). But on a home machine they load the reports program and it will allow them to view reports based on their servers database.

I've got the reports being displayed (albeit ugly because I'm not really sure what I'm doing) on my machine which is connecting to our server. Now, in the program I used the drag-n-drop approach to creating an initial dataset (based on an empty database table). From that point on, the reports are generated from a new dataset using a stored procedure.

How do I get the user to be able to change the initial dataset (which is created during design time) so it hits *their* database to return the empty dataset Is there a way to do this or am I going to have them always hitting my database for the default empty dataset and then using theirs from the stored proc

Sorry if this is a total newbie question but I am a total newbie when it comes to report tools and very, very new to VS 2005. If you have any suggestions, they would be most appreciated (and if your suggestions can be written very clearly for a newbie that would be even better).

Thanks.

OOT_In_Atlanta


Answer this question

Changing design time dataset/connection at runtime?

  • Gnome.com

    You can assign a dataset programmatically using the ReportViewer.LocalReport.DataSources collection. When you used drag and drop to create a data set at design time, this is the code that was generated in the designer.cs file.
  • Mike Graham - Denver

    At runtime you can set the database to query by setting the Connection property of TableAdapter.
  • kelly hughes

    If I can do the DataSet programmatically at runtime, should I just delete the dataset etc. that was created when I did it at design time I thought (and excuse my ReportViewer newness here) that we had to tie the report to a dataset at designtime in order to make the "layout". Is this wrong If so, how would I go about doing this at runtime Thanks for your assistance and help.

  • Changing design time dataset/connection at runtime?