title: Inserting a byte array into SQL Server database table
body: <p>I'm using the PBKDF2 hashing algorithm for passwords which produces a byte array from my user supplied password, like so:</p>
  
  <pre><code>var DeriveBytes = new Rfc2898DeriveBytes(_Password, 20);
  byte[] _Salt = DeriveBytes.Salt;
  byte[] _Key = DeriveBytes.GetBytes(20);  // derive a 20-byte key
  </code></pre>
  
  <p>I want to save these into my database, but I'm not sure what data type to use. From what I can see there's no data type used for byte arrays and I'm pretty sure I can't just convert it to a string and store it with <code>varchar</code>, or can I?</p>