It might seem a dumb question to you guys. I have one SQL table with one binary column. It has some data in binary format.
e.g. 0x9A8B9D9A002020202020202020202020<
0x9A8B9D9A002020202020202020202020<
public static byte[] ConvertToBinary(string str) { System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); return encoding.GetBytes(str); }
or
Convert.ToByte(string);