473,320 Members | 2,109 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,320 software developers and data experts.

How to insert a byte array into sql server?

Hi all,

Can anybody tell how to insert a byte array into sql server...

Looking forward for ur reply...

Nov 17 '05 #1
1 4062
if you use stored procedure, simply add a parameter similar to :
SqlParameter param = new SqlParameter("@MyBinaryColumn", SqlDbType.Binary);
param.Value = ary;

or if you use dynamic sql / embedded sql string, parameterize your sql
string like:

"insert into MyTable(MyBinaryColumn) values(@MyBinaryColumn"

then add parameter same as you do with stored procedures.
Nov 17 '05 #2

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

Similar topics

2
by: Niraj | last post by:
Hi, I am trying to do bulk insert of binary data (array of bytes) in an Oracle table. The data type of the table is BLOB. I am using Oracle Objects for OLE (OO4O) in C++. The binary data that I...
11
by: Chris Fink | last post by:
I have setup an Oracle table which contains a blob field. How do I insert data into this field using C# and ADO.net?
8
by: intrepid_dw | last post by:
Hello, all. I've created a C# dll that contains, among other things, two functions dealing with byte arrays. The first is a function that returns a byte array, and the other is intended to...
8
by: frekster | last post by:
Hi. I used to be able to do this easily in vb 6 via looping and preserving the source array data/size etc. How can I do this in vb.net? I've been trying for a while now and this should be...
10
by: Danny | last post by:
I am working on a project where I will receive xml documents from clients machines as a byte array. They will use the web browser navigate method to post the data to my ASP.NET page. I then pick up...
7
by: Kevin Lawrence | last post by:
Hi all I want to do "INSERT INTO Table (Blob) Values('blobdataasstring')". ...rather than using the parameter driven method, is it possible? And if so what encoder do I use to convert the...
3
by: Me | last post by:
Trying to get the current status of the insert key. Found my.computer.keyboard.capslock, but no such item for insert key. Anyone have some code to help. Can't figure out getkeystate. compiler...
7
by: james | last post by:
Hi, I am trying to insert a record into a database table, one field of which is a byte array. Using the below: Byte imgArr; .... <code to put image into imgArr>
3
by: ist | last post by:
Hi, I am trying to get (and transfer over ASP.NET) some encrypted data from some MySQL fields. Since the data contains many unicode characters, I tried to get the data as a series of ASCII...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.