I have a following problem - I'm trying to save byte[]
to database and I just figured out that it works for one byte only.
I have number of floats that I convert to byte[] and use that as a parameter:
param = new SqlParameter(name, type, ((byte[])value).Length);
type is VarBinary
, value is the byte array.
I add that parameter to my SqlCommand
and just before it gets executed the whole byte array "sits" in that parameter and _msize
of that parameter is correct (20 for 20 bytes I assume is correct). My SQL Server shows me only 1 byte saved, also trying to retrieve it back I'm getting only one byte. My column is VarBinary(200)
.
Any suggestions?