title: linq to sql query in a background worker Invalid cross-thread access
body: <p>This code throws a <code>System.UnauthorizedAccessException: Invalid cross-thread access exception</code>.</p>
  
  <pre><code>private void DoWorker(object sender,DoWorkEventArgs e)
  {
      BackgroundWorker worker = sender as BackgroundWorker;
  
      using (DbContext db = new DbContext(DbContext.littreConnectionString))
      {
          if (db.DatabaseExists())
          {
              var searchResults = from dbObject in db.LDicTable
                                  where dbObject.word == SearchBox.Text
                                  select dbObject;
              if (!searchResults.Any())
              {
                  wordExists = false;
              }
          }
      }
  }
  </code></pre>