store a null in varbinary

G

Guest

hey all,
could someone please show me how to store a null value in my database
record's varbinary field using a paramerterized query?

The following doesn't work:

SqlParameter prm = new SqlParameter("@BLOBData",
SqlDbType.VarBinary, bytBLOBData.Length, ParameterDirection.Input, false,
0, 0, null, DataRowVersion.Current,
bytBLOBData);
prm.Value = DBNull.Value;
cmd.Parameters.Add(prm);

thanks,
rodchar
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top