Mustafa TURK

Mustafa TURK

  • NA
  • 7
  • 513

Got ObjectDisposedExceptionerror after opening

Aug 2 2017 7:56 PM
I get ObjectDisposedException  after opening of the program.
 
The program is a form app and uses sqlite. I think it happens because I try to access form elements. I read some articles about this issue but I could not resolve.
 
 
 Form(){
 
CheckForIllegalCrossThreadCalls = false;
// other codes 
 
}
 
 
private void button1_Click(object sender, EventArgs e)
{
panel1.Visible = false;
panel2.Visible = true;
List products = new DbOperations().getAllProducts();
BindingSource source = new BindingSource();
source.DataSource = products;
dataGridView1.DataSource = source;
}
 
at this point, I got that error. 

Answers (3)