473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1682
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.