I am having TByteDynArray object that represents some binary data (file) that I want to store to MS SQL Server database table in varbinary(MAX) column. How can I do it?
I am using C++ Builder XE7 and ADO components and would like to avoid using TADOTable since it would force me to load the entire table.
First you have to create a ADO stream object with your data.
http://www.w3schools.com/asp/ado_ref_stream.asp
Then using ADO "connection->execute" command, insert the stream object into respective table and column using SQL "INSERT" statement.
如果使用的是TADOQuery
,则可以Insert()
一行中Insert()
或Edit()
,然后为该行中的所需字段调用CreateBlobStream()
方法,然后将字节写入提供的TStream
对象。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.