[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

Storing BLOB's with OdbcCommand

Markus

9/10/2002 2:02:00 PM

Hi

How can I store a BLOB (adLongVarBinary) with the OdbcCommand Object?

I have to use an SQL-Statment like "insert into mytable(description, binary)
values(?,?)"

The source is from a dataset like:

Dim byteBLOB() as Byte

byteBLOB = MyDataSet.Tables(0).Rows(0)("BLOBField")

Thanks

markus



1 Answer

Markus

9/13/2002 3:52:00 PM

0

I found the solution by my self:

strSQLQuery = "INSERT INTO mytable(description, binary) VALUES (?,?)"

oCommand = New OdbcCommand(strSQLQuery, m_DBConnection)

Dim pc As OdbcParameterCollection = oCommand.Parameters

pc.Add("description", OdbcType.Char, 38)

pc.Add("binary", OdbcType.Image)

pc("description").Value = u_strName

pc("binary").Value = u_byteBLOB

intChangedRecords = oCommand.ExecuteNonQuery


"Markus" <markus.kobelt@sfch.com> wrote in message
news:udNoLqMWCHA.436@tkmsftngp10...
> Hi
>
> How can I store a BLOB (adLongVarBinary) with the OdbcCommand Object?
>
> I have to use an SQL-Statment like "insert into mytable(description,
binary)
> values(?,?)"
>
> The source is from a dataset like:
>
> Dim byteBLOB() as Byte
>
> byteBLOB = MyDataSet.Tables(0).Rows(0)("BLOBField")
>
> Thanks
>
> markus
>
>
>