updating blobs

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

this is what I'm trying to do:

myActionQuery = "UPDATE MyTable SET " & _
", Data = " & mData & _
" Where ObjectID = " & mObjectID

where mData is an array of bytes

this is the error msg I'm getting:
Operator '&' is not defined for types 'String' and '1-dimensional array of
Byte'.

any suggestions?
 
Well, the Easy way to do it is to Parameterize your query and - you can use
Binary or Image. Non paramaterized query are the work of the devil -
they're nothing but headaches

Byte[] b = new Byte[10000];

SqlParameter prm = new SqlParameter("@Whatever", SqlDbType.Binary);

prm.Value = b;

CommandObject.Paramaters.Add(prm);
 
you are trying to concatenate two different types using an operator that is
not defined for it.

Convert the array of bytes to a string first. Better yet, since you are
updating a blog, use a parameterized method, so that you can simply pass the
array directly to SQL (assuming this is SQL Server).

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
Back
Top