title: order datatable by relevance using linq by column values which are comma sperated
body: <p>I have a Datatable that contains a column called Tags, Tags can have values such as</p>
  
  <pre><code>row[0] = Tag1
  row[1] = Tag1, Tag2
  row[2] = Tag2, Tag3
  row[3] = Tag1, Tag2, Tag3
  row[4] = Tag4, Tag6
  </code></pre>
  
  <p>and are seperated by comma's</p>
  
  <p>etc..</p>
  
  <p>I have the value of Tags for the current document and have run a query to select all other documents that have either of the Tags in there row. for example lets say the current document Tags are (Tag1, Tag2, Tag3)</p>
  
  <p>so from the example rows above all the rows above are returned apart from row[4]</p>
  
  <p>Here is the bit i'm lost with, i now want to sort the datatable by how many tags are matched with the current document. so for the example i've talked about so far they should be ordered</p>
  
  <pre><code>row[3] = Tag1, Tag2, Tag3
  row[1] = Tag1, Tag2
  row[2] = Tag2, Tag3
  row[0] = Tag1
  </code></pre>
  
  <p>Not used linq before but was told it could do this.</p>
  
  <p>so far i have</p>
  
  <pre><code>var query = from c in dt.AsEnumerable()
                      orderby c.Field&lt;string&gt;("Tags").CompareTo(dr["Tags"]) ascending
                      select c;
  </code></pre>