title: How to return count of distinct and repeated values in a datatable?
body: <p>I have an excel sheet I upload. It has columns for the usernames and which server they are registered for. I want to count the number of rows of each unique username on each of the servers.</p>
  
  <pre><code>Table:
  Username | Server
  bob        Production0
  bob        Production1
  mike       Production1
  Jerry      Production2
  Tom        Production0
  
  Output:
  On Production0 = 2 Unique Users (Bob and Tom)
  Production1 = 2 Unique Users (Bob and Mike)
  Production2 = 1 Unique Users (Jerry)
  </code></pre>
  
  <p>So for Production0 for example, I want to figure out how to make the Username get unique names but keep the name if its on a different server as well:</p>
  
  <pre><code>DataView newView = new DataView(uploadedfileDataTable);
  //Get only the username and Server columns     
  DataTable wantedTable = newView.ToTable(false,"Column A","Column B"); //Get only the username and Server columns
       int prodCount = wantedTable.AsEnumerable().Count(row =&gt; row.Field&lt;string&gt;("Column A") ==  "//HOW TO MAKE DISTINCT" &amp;&amp; row.Field&lt;string&gt;("Column B") == "Production0");
       numUsersProd0.Text = prodCount.ToString();
  </code></pre>