title: Comparing TimeStamp value in C#
body: <p>I created a new column in an existing database, to allow me a RowVersion for concurrency operations:</p>
  
  <pre><code>alter table MyTable add ColumnName rowversion
  </code></pre>
  
  <p>In my class I added the following property</p>
  
  <pre><code>public byte[] ColumnName { get; set; }
  </code></pre>
  
  <p>In the one method that uses this class i get the error when using this property</p>
  
  <p><em>Cannot implicitly convert type 'System.Data.Linq.Binary' to 'byte[]'</em>  </p>
  
  <p>I overcome this by adding ToArray <code>(myObj.ColumnName.ToArray())</code> to the property.</p>
  
  <p>In my ASP .Net page I add a hidden control to a Repeater and assign the value as</p>
  
  <pre><code>RowHiddenField.Value = Convert.ToBase64String(myObj.ColumnName);
  </code></pre>
  
  <p>Now i am trying to compare this column with the object passed in</p>
  
  <pre><code>public bool RowModified(MyObject myObj)
  
  objFound = GetAllObjects.First(o=&gt; o.ID = myObj.ID);
  
  If (objFound.ColumnName == myObj.ColumnName)
  </code></pre>
  
  <p>but the values are never the same?</p>
  
  <p>After reading a few links in converting TimeStamp, i've attempted them but either they didnt work (could be i was confused and did something wrong) or it didnt apply to my scenario.</p>
  
  <p>Appreciate any help on this.</p>