title: what is the fastest way to generate a unique set in .net 2
body: <p>I have what is essentially a jagged array of name value pairs - i need to generate a set of unique name values from this. the jagged array is approx 86,000 x 11 values.
  It does not matter to me what way I have to store a name value pair (a single string "name=value" or a specialised class for example KeyValuePair).<br>
  <strong>Additional Info:</strong> There are 40 distinct names and a larger number of distinct values - probably in the region 10,000 values.</p>
  
  <p>I am using C# and .NET 2.0 (and the performance is so poor I am thinking that it may be better to push my entire jagged array into a sql database and do a select distinct from there).</p>
  
  <p>Below is the current code Im using:</p>
  
  <pre><code>List&lt;List&lt;KeyValuePair&lt;string,string&gt;&gt;&gt; vehicleList = retriever.GetVehicles();
  this.statsLabel.Text = "Unique Vehicles: " + vehicleList.Count;
  
  Dictionary&lt;KeyValuePair&lt;string, string&gt;, int&gt; uniqueProperties = new Dictionary&lt;KeyValuePair&lt;string, string&gt;, int&gt;();
  foreach (List&lt;KeyValuePair&lt;string, string&gt;&gt; vehicle in vehicleList)
  {
      foreach (KeyValuePair&lt;string, string&gt; property in vehicle)
      {
          if (!uniqueProperties.ContainsKey(property))
          {
              uniqueProperties.Add(property, 0);
          }
      }
  }
  this.statsLabel.Text += "\rUnique Properties: " + uniqueProperties.Count;
  </code></pre>