private void Form1_Load(object sender, EventArgs e) { using (linqDataContext linq = new linqDataContext()) { temp tmp = new temp(); linq.ExecuteCommand("delete from temp"); } }
//main function of the program public bool main_function() { if (contunie) { using (linqDataContext linq = new linqDataContext()) { var sorgu = (from p in linq.temps select p); foreach (var item in sorgu) { Thread th = new Thread(() => control_prime_numbers(Convert.ToInt32(item.bas), Convert.ToInt32(item.son))); th.Start(); } temp tmp = new temp(); linq.ExecuteCommand("delete from temp"); } return(true); } else { backgroundWorker1.CancelAsync(); return(false); } }