title: LINQ to Entities does not recognize the method 'System.String get_Item (System.String)',
body: <p>How can I solve this problem?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    DateTime dtInicio = new DateTime();
      DateTime dtFim = new DateTime();
      Int32 codStatus = 0;
  
      if(!string.IsNullOrEmpty(collection["txtDtInicial"]))
          dtInicio = Convert.ToDateTime(collection["txtDtInicial"]);
      if(!string.IsNullOrEmpty(collection["txtDtFinal"]))
          dtFim = Convert.ToDateTime(collection["txtDtFinal"]);
      if (!string.IsNullOrEmpty(collection["StatusCliente"]))
          Convert.ToInt32(collection["StatusCliente"]);
  
      var listCLientResult = (from c in db.tbClientes
                             orderby c.id
                              where (c.effdt &gt;= dtInicio || string.IsNullOrEmpty(collection["txtDtInicial"]) &amp;&amp;
                                   (c.effdt &lt;= dtFim || string.IsNullOrEmpty(collection["txtDtFinal"])) &amp;&amp;
                                   (c.cod_status_viagem == codStatus || string.IsNullOrEmpty(collection["StatusCliente"])))
                                   select c);
      return View(listCLientResult);
  </code></pre>
  
  <p>The error I am getting is:</p>
  
  <p>LINQ to Entities does not recognize the method 'System.String get_Item (System.String)', which can not be converted into an expression of the repository.</p>