title: Find matching values in 2 arrays c#
body: <p>So i am trying to do a match between filenames and a SQL dataset.</p>
  <p>E.g. Recordset contains
  a array of 1000,1001,1002,1003</p>
  <p>and my filelist contains
  a array of &quot;c:\temp\100.txt&quot;,&quot;c:\temp\1000.txt&quot;,&quot;c:\temp\1001.txt&quot;,&quot;c:\temp\2002.txt&quot;,&quot;c:\temp\100.txt&quot;,&quot;c:\temp\1000-1.txt&quot;</p>
  <p>So my aim is to get a result of :</p>
  <p>c:\temp\1000.txt
  c:\temp\1001.txt
  c:\temp\1000-1.txt</p>
  <p>How do i accomplish that?</p>
  <p>I've tried something like this</p>
  <pre><code>     private static String[] GetImageList()
      {
          return Directory.GetFiles(&quot;C:\\tempbilledeimport\\&quot;, &quot;*.*&quot;, SearchOption.AllDirectories);
  
      }
  
      private static List&lt;string&gt; SQLRecordset()
      {
          List&lt;string&gt; items = new List&lt;string&gt;();
  
          string queryString = &quot;select item from inventory where WebUseOnWeb=1&quot;;
          using (SqlConnection connection = new SqlConnection(DatabaseConnection.SqlConnectionStringCompany))
          {
              SqlCommand command = new SqlCommand(queryString, connection);
              connection.Open();
              SqlDataReader reader = command.ExecuteReader();
  
              // Call Read before accessing data.
              items.Add(reader[0].ToString());
              reader.Close();
          }
  
          return items;
      }
  </code></pre>
  <p>But how do i compare them?</p>