🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.database.dotnet
3 messages
3 total messages Started by Brigitte Spatz Wed, 31 Jan 2007 08:04
Retrieving an image/varbinary(MAX) from database?
#15
Author: Brigitte Spatz
Date: Wed, 31 Jan 2007 08:04
8 lines
1372 bytes
On the Web I've found a C# example of how to retrieve an image stored as 
varbinary(MAX) from SQL Server:
byteBLOBData = (Byte[])(ds.Tables["BLOBTest"].Rows[c - 1]["BLOBData"]);
but I can't find what the Delphi equivalent of the (Byte[]) conversion is.

TIA.

Brigitte
Re: Retrieving an image/varbinary(MAX) from database?
#16
Author: Craig
Date: Wed, 31 Jan 2007 10:03
15 lines
1472 bytes
Brigitte Spatz wrote:
> On the Web I've found a C# example of how to retrieve an image stored as 
> varbinary(MAX) from SQL Server:
> byteBLOBData = (Byte[])(ds.Tables["BLOBTest"].Rows[c - 1]["BLOBData"]);
> but I can't find what the Delphi equivalent of the (Byte[]) conversion is.
> 

of the top of my head I think i did something like this

type
   ByteArray = array of byte;
var
   byteBlobData: ByteArray;
begin
   byteBlobData := ByteArray(ds.Tables["BLOBTest"].Rows[c - 1]["BLOBData"]);
Re: Retrieving an image/varbinary(MAX) from database?
#17
Author: Brigitte Spatz
Date: Wed, 31 Jan 2007 10:13
22 lines
1831 bytes
Craig wrote:
> Brigitte Spatz wrote:
>> On the Web I've found a C# example of how to retrieve an image stored 
>> as varbinary(MAX) from SQL Server:
>> byteBLOBData = (Byte[])(ds.Tables["BLOBTest"].Rows[c - 1]["BLOBData"]);
>> but I can't find what the Delphi equivalent of the (Byte[]) conversion 
>> is.
>>
> 
> of the top of my head I think i did something like this
> 
> type
>   ByteArray = array of byte;
> var
>   byteBlobData: ByteArray;
> begin
>   byteBlobData := ByteArray(ds.Tables["BLOBTest"].Rows[c - 1]["BLOBData"]);

It's working :-))))) Thank you so much. I'd trawled what feels like the 
whole of the Web but didn't find this one anywhere...

Brigitte
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads