|
I create a report using ReportViewer tool and everything works fine until I close the form. When I do that and choose another option of my main menu that involve the database I always received an error message that the database cannot be opened. Error Message says "System.Data.SqlClient.SqlException, Cannot open database..." But if first I open a choice that do some work with the database and then call the form of my report everything works fine. I have this code on my report form: namespace SACK { public partial class repProductos : Form { public repProductos() { InitializeComponent(); } private void repProFecMov_Load(object sender, EventArgs e) { this.tProductosTableAdapter.Fill(this.PrintProductsDBDataSet.tProductos); this.reportViewer1.RefreshReport(); this.tProductosTableAdapter.Connection.Close(); // ----> I TRY WITH THIS TO CLOSE THE CONNECTION BUT IT NOT WORKS. } } } thank you for any help!
Think left and think right and think low and think high. Oh, the things you can think up if only you try!- Edited bydgoldfeder Sunday, August 09, 2009 6:42 PM
-
|