So, I've been working on Version 7 of my TableViewer program, and was a bit stumped on working with byte datatypes. Microsoft provides an easy way to convert that to a string so you can see it:
"0x" + BitConverter.ToString(((byte[])dgv.SelectedCells[0].Value)).Replace("-", "")
The BitConverter will return your bytes separated by dashes. However, if you want to update/insert that data, you don't want the dashes there, so I replaced them. You also need to preface your byte string with '0x' so the database engine will know you're passing in a byte value.
The blocker came on how to successfully reverse that. I found this great Linq solution on Stack Overflow posted by user JaredPar:
byte[] val = Enumerable.Range(0, text.Length)
.Where(x => x % 2 == 0)
.Select(x => Convert.ToByte(text.Substring(x, 2), 16))
.ToArray();
I pass in the byte string without the leading '0x' (00AB01FE...) as a variable named text. The Linq query enumerates through each character, stopping every two characters by doing a modulo (x => x % 2 == 0), then converts the value to an actual byte value (Convert.ToByte(text.Substring(x, 2), 16)). When it's done, puts the whole thing out as an array. Brilliant!