0

I want to INSERT a byte array into a table (using C#). I've seen this: SqlParameterCollection.Add but I can't figure out how to use it - it doesn't seem to have a value parameter like AddWithValue does. (Perhaps there's some way to use AddWithValue with byte arrays?)

And the same goes for a SELECT - I want to SELECT a row WHERE ColumnX = MyByteArray. (The column contains binary).

So how is it done?

ispiro
  • 25,277
  • 32
  • 126
  • 258

1 Answers1

0

You can use paramete datatype VarBinary

Cmd.Parameters.Add("@ArrayValues", SqlDbType.VarBinary, 100).Value = YourArrayList;