title: How to compare SQL Server CDC LSN values in C#?
body: <p>In SQL its easy as it supports the binary(10) LSN values for comparison:</p>
  
  <pre><code>SELECT *, __$start_lsn, __$seqval
  FROM cdc.fn_cdc_get_all_changes_dbo_sometable(@startLsn, @endLsn, 'all update old') 
  WHERE __$seqval &gt; @seqval 
  ORDER BY __$start_lsn, __$seqval
  </code></pre>
  
  <p>In C# it's more difficult:</p>
  
  <pre><code>byte[] mySeqval = ...
  foreach(var row in cdcData)
  {
      if(row.seqval &gt; mySeqval) // Cannot perform this
          ...
  }
  </code></pre>
  
  <p>Can the LSN / SeqVal values be converted into a number than can be compared easily?
  These are 10 bytes (80 bits) in size.</p>
  
  <p>My project is in .Net 3.5</p>