title: Cant search with a different record of a database
body: <p>I am new here and have been at this for ages and i cant solve the problem. I have the following code in my ShowAllReview Controller:</p>
  
  <pre><code> public ActionResult Index(string Ordering, string WordFilter, string DisplaySearchResults, int? CounterForPage)
          {
              using (var db = new gamezoneDBEntities())
              {
  
                  ViewBag.Message = TempData["message"];
                  ViewBag.CurrentSort = Ordering;
                  ViewBag.NameSortParm = String.IsNullOrEmpty(Ordering) ? "GameName" : "";
                  ViewBag.DateSortParm = Ordering == "ReleaseYearOfGame" ? "DiscriptionOfGame" : "Date";
  
  
                  {
                      TempData["DisplaySearchResult"] = DisplaySearchResults;
  
                      {
                          ViewBag.search = DisplaySearchResults;
                      }
                      if (Request.HttpMethod == "GET")
                      {
                          DisplaySearchResults = WordFilter;
                      }
                      else if (DisplaySearchResults == "")
                      {
                          ViewData["MyMessage"] = "Nothing Has Been Entered.";
  
                      }
  
                      else
                      {
                          CounterForPage = 1;
                      }
  
                      ViewBag.CurrentFilter = DisplaySearchResults;
  
  
                      var FullDatabaseItem = from b in db.tblReviews.Include(x =&gt; x.tblGame)
                                             select b;
  
  
  
                      if (!String.IsNullOrEmpty(DisplaySearchResults))
                      {
  
                          FullDatabaseItem = FullDatabaseItem.Include (x =&gt; x.tblGame)
                         .Where (b =&gt; b.Score.ToUpper().Contains(DisplaySearchResults.ToUpper()));
  
                      }
  
                      switch (Ordering)
                      {
                          case "HeadlineName":
                              FullDatabaseItem = FullDatabaseItem.OrderBy(b =&gt; b.Score);
                              break;
                          case "DatePosted":
                              FullDatabaseItem = FullDatabaseItem.OrderBy(b =&gt; b.Recomendation);
                              break;
                          case "DiscriptionDate":
                              FullDatabaseItem = FullDatabaseItem.OrderBy(b =&gt; b.Recomendation);
                              break;
                          default:
                              FullDatabaseItem = FullDatabaseItem.OrderByDescending(b =&gt; b.Recomendation);
                              break;
                      }
  
                      int pageSize = 3;
                      int pageNumber = (CounterForPage ?? 1);
                      var PageNumberResults = FullDatabaseItem.ToPagedList(pageNumber, pageSize);
                      ViewBag.PageNumberResults = FullDatabaseItem.Count();
                      if (PageNumberResults.Any())
                      {
  
                          return View(PageNumberResults);
                      }
  
                      return View("ErrorView");
                  }
              }
          }
  </code></pre>
  
  <p>as you can see i have added this code:</p>
  
  <pre><code>var FullDatabaseItem = from b in db.tblReviews.Include(x =&gt; x.tblGame)select b;
  </code></pre>
  
  <p>With out the include on the reviews table the view would throw up the following error:</p>
  
  <pre><code>The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
  </code></pre>
  
  <p>Now the problem is with this line of code:</p>
  
  <pre><code>FullDatabaseItem = FullDatabaseItem.Include (x =&gt; x.tblGame)
                          .Where (b =&gt; b.Score.ToUpper().Contains(DisplaySearchResults.ToUpper()));
  </code></pre>
  
  <p>am trying to get the game name so when the user is using my search he can obtain a record buy just typing in the name of the game. But as you can see the field being searched is <code>"Score"</code> which is the tblReview field as the field i need <code>"GameName"</code> will not work in there as it says it does not exsit. </p>
  
  <p>I need help in solving the problem </p>
  
  <p>Any more information you require please ask me and i shall provide</p>
  
  <p>Thank You</p>