private void Button1_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { excel = new ExcelFile(openFileDialog1.FileName); } OleDb.GenerateConnectionString(excel); GC.Collect(); GC.WaitForPendingFinalizers(); }