read Mask value from sql to c#
<p>I have sql mask data field value as 0x00000001 in the database. I want to read this value in c#. When I am tryiing to read the value as follows</p>

<pre><code>  Byte[] Mask = new Byte[255];
  Mask = (Byte[])sdr["Mask"];
  string abc = BitConverter.ToUInt64(Mask, 0).ToString("X");
</code></pre>

<p>But I am getting the following error,</p>

<pre><code>System.ArgumentException: Destination array is not long enough to copy all the items in the collection. Check array index and length.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.BitConverter.ToInt64(Byte[] value, Int32 startIndex)
   at System.BitConverter.ToUInt64(Byte[] value, Int32 startIndex)
</code></pre>

<p>Please help me with this.</p>

<p>Thanks</p>
