I am using a LINQ query in backgroundworker. When I run the program and execute the query it works properly. But when I change a value in table manually and run the query again this return last result to me and I should close the program and run it again to see the changes!
Please help me to resolve this problem.
clockEntities objDb = new clockEntities();
private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e)
{
var inOutList = (from may in objDb.Taradods
where may.Date.Contains("2014/02") && may.BarCodeNo == 8011
select may);
this.Invoke(new MethodInvoker(delegate() {
dataGridView1.DataSource = inOutList.ToList(); }));
}