title: DataTable.Select throws EvaluateException: Cannot perform '=' operation on System.Double and System.String
body: <p>I am importing data from multiple spread sheets into a single database table.</p>
  
  <p>To start I've loaded the entire excel file into a data set, 1 page = 1 table.  I then looped over all the pages and added the columns to the new combination table.  Finally, I will take each row, find the corresponding row in the other pages and copy the data into a new row in the new table.  I need to use a combination of 3 columns to perform this match: 'Brand', 'Model' and 'Yr'.  Here is the loop for the last step.</p>
  
  <pre><code>//Add Data
  foreach (DataRow drBase in tableSet.Tables[0].Rows)
  {               
      List&lt;DataRow&gt; drSelect = new List&lt;DataRow&gt;(); //selected rows for specific bike
      foreach(DataTable dt in tableSet.Tables)
      {
          string expression="";
          foreach (string colName in joiningCols)
          {
              if (drBase[colName].ToString() == "") break;
              if (!string.IsNullOrWhiteSpace(expression))
              {
                  expression += " and ";
              }
  
              expression += string.Format("{0} = '{1}'",colName, drBase[colName].ToString().Trim());
          }
          DataRow[] temp= { };
          if (!string.IsNullOrWhiteSpace(expression))
          {
          temp = dt.Select(expression);   //This is the line throwing the exception                     
          }
  
          if (temp.Length == 1)
          {
              drSelect.Add(temp[0]);
              //Debug.Print(string.Format("Match found {0} on {1}", expression, dt.TableName));
          }
          else
          {
              Debug.Print(string.Format("Incorrect number of matches ({2}) to &lt;{1}&gt; on Table[{0}]", dt.TableName, expression, temp.Length));
              continue;
          }
      }
  
      if (drSelect.Count == 2)
      {
          DataRow current = resultTable.NewRow();
  
          for (int t = 0; t &lt; tableSet.Tables.Count; t++)
          {
              foreach (DataColumn c in tableSet.Tables[t].Columns)
              current[c.ColumnName] = drSelect[t][c.ColumnName];
          }
  
          resultTable.Rows.Add(current);
      }                
  }
  </code></pre>
  
  <p>The exception is:</p>
  
  <pre><code>EvaluateException was unhandled
  An unhandled exception of type 'System.Data.EvaluateException' occurred in System.Data.dll
  
  Additional information: Cannot perform '=' operation on System.Double and System.String.
  </code></pre>
  
  <p>The value of 'expression' during the exception is "Brand = 'BMW' and Yr = '1997-2000' and Model = 'F 650'"</p>
  
  <p>The error, and my research, say that I should enclose all the values as strings, which I've done.  None of the columns in excel use a special format, so all should default to text.  The only column that may contain only numbers is the year, but since it was able to do several iterations  before stopping I do not believe the error is pointing to another row.</p>
  
  <p>After some testing, where I broke up the expression into parts (A, B and C) it only crashed when selecting on A and C ("Brand = 'BMW' and Yr = '1997-2000'")  Not when I select by each clause individually.</p>
  
  <p>What am I missing?  Where is this double it is trying to compare?</p>