title: passing byte[] from C# to sql table via XML
body: <p>I Have basically calculated SHA512 hash and I get it in byte[], all I want to do is to store it in my DB, the current infrastructure is such that i need to create a XML of my data and this XML gets passed to a SP which inserts the data. So the flow becomes</p>
  
  <p>byte[] -> string (using BitConverter) -> XML -> binary(64)(using OPENXML)</p>
  
  <p>I think this can be improved, but unfortunately I cannot change the infrastructure, so the XML has to be in between, also what happens is that the XML data I had -</p>
  
  <p>1031B4BFC79B4E6357FE271FF2313D37A90E29FCAAEC850E5C4044547C1184AE </p>
  
  <p>becomes </p>
  
  <p>0x31003000330031004200340042004600430037003900420034004500360033003500370046004500320037003100460046003200330031003300440033003700</p>
  
  <p>in the db</p>
  
  <p>This does not look like the binary form of original data. Any explanation on whats happening?</p>