473,466 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

updating blobs

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?

Jul 21 '05 #1
2 1685
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);

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"JohnK" <Jo***@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...
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?

Jul 21 '05 #2
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.
--
"JohnK" <Jo***@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...
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?

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Michael Walton | last post by:
I am trying to write some code that inserts or updates a text field in my SQL Server 2000 database. The SQL statement is created using a submit from a form, and the text is coming from a...
0
by: Ole Hansen | last post by:
Hi, Is it at all possible to insert BLOBs using the Array Interface? Today I have an application using the array interface. It works fine but so far I haven't been using BLOBs. I insert...
7
by: Howard Lowndes | last post by:
My situation is that I am interacting PHP 4.1.2 to PostgreSQL 7.2.2 I have no difficulty inserting and managing BLOBs into the Large Object system table, and I have a user table called images...
7
by: Nilabhra Banerjee | last post by:
Hi, I am still not sure whether the BLOBS are actually stored in the database or they have the pointer to the database for that file in the filesystem. If I remove the files (sources) for BLOBS...
0
by: Bing | last post by:
Hi there, I am using the DB2 universal JDBC driver type 4 to insert BLOBs into a DB2 database. The Method I used for supplying the BLOB data value is setBinaryStream(). Everything works fine as...
14
by: WindAndWaves | last post by:
Hi Gurus I have been working on a rather sophisticated update procedure for FEs of my application that are spread throughout the country. Now, I recently thought: WHAT IF I identify all the...
2
by: JohnK | last post by:
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...
2
by: Jerry LeVan | last post by:
Hi, I am just getting into large objects and bytea "stuff". I created a small db called pictures and loaded some large objects and then tried to do a restore. Here is how I got the dump. ...
5
by: KenRoy | last post by:
Is there any way to do this without removing the object and then re-adding it with the updated property. Public Structure Blob Public f1 as String Public f2 as Boolean End Structure I then...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.