Hi,
I am using Firebird .Net 1.4 beta4 net framework version 1.1.
The getbytes would not return a data for blob columns.
It look like have a bug in Getbytes procedure.
Below is the source.
Pls Help ..
Regards
Teh
Dim sql As String
sql = "SELECT Picture FROM Categories WHERE categoryid=11"
Dim cmd As New FbCommand(sql)
Dim conn As New FbConnection(ConnectionStr)
conn.Open()
Dim tx As FbTransaction
tx = conn.BeginTransaction
cmd.Connection = conn
cmd.Transaction = tx
Dim PictureCol As Integer = 0
Dim dr As FbDataReader = cmd.ExecuteReader()
Dim id As Integer
dr.Read()
' id = dr.GetInt32(0)
Dim b(dr.GetBytes(PictureCol, 0, Nothing, 0,
Integer.MaxValue) - 1) As Byte
' Dim b(dr.GetValue(PictureCol))
dr.GetBytes(PictureCol, 0, b, 0, b.Length)
dr.Close()
conn.Close()
Dim destfilepath As String = "d:\test15beta.jpg"
Dim fs As New System.IO.FileStream(DestFilePath,
IO.FileMode.Create, IO.FileAccess.Write)
fs.Write(b, 0, b.Length)
fs.Close()
|