I have a problem with Microsoft report viewer
I have a database hosted in localhost through Sqlserver 2005 and I want to make a report about it using report viewer through VS 2008
When I tried this and make the report form as a main startup form it works fine and the report displayed with the right data fine
When I tried to make a normal start up form that has a button, this button's function is to show a report form and display the report in this form
When I tried this the program is closed when it tries to open the report form
When I debug it I found that when it reach the code line that refresh the report the program is terminated
The code of the button in the startup form is:
Displayreport Ldisplay = new Displayreport ();
Ldisplay.Show();
And the code in the constractor of the form is:
this.DataTable1TableAdapter.Fill(this.DataSet1.DataTable1, client_ID);
this.reportViewer1.RefreshReport();
[edit]Code blocks added - OriginalGriff[/edit]