How to insert a byte array into sql server?

  • Thread starter Thread starter Prince
  • Start date Start date
P

Prince

Hi all,

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

Looking forward for ur reply...
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top