Does LLBLGeb support accessing SQL Server blob fields as C# IO.Streams

Posts   
 
    
vasian
User
Posts: 2
Joined: 08-Feb-2013
# Posted on: 08-Feb-2013 08:42:35   

Hi,

Does LLBLGen support accessing / mapping SQL Server blob fields as C# IO.Streams?

(using LLBLGen 3.1 Pro)

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 08-Feb-2013 10:29:51   

Are you speaking about SQLServer's FileStreams?

vasian
User
Posts: 2
Joined: 08-Feb-2013
# Posted on: 08-Feb-2013 10:52:30   

Yes, either using FILESTREAMS or by using blobs, using the newer SqlDataReader.GetStream, or using workarounds:

FileStreams http://msdn.microsoft.com/en-us/magazine/dd695918.aspx

SqlDataReader.GetStream http://msdn.microsoft.com/en-us/library/hh556234.aspx

Workaround for blobs http://stackoverflow.com/questions/2101149/how-to-i-serialize-a-large-graph-of-net-object-into-a-sql-server-blob-without-c

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39615
Joined: 17-Aug-2003
# Posted on: 08-Feb-2013 13:37:26   

No, we don't support those. The reason is that the entity materialization is done in 1 go, so there's no 'read the stream later' feature when you fetch entities: when they're read, their data is in memory and the connection is closed. So blobs/clobs/image/text fields are read in-line with the other data.

You can read them later by first excluding them from the fetch using the Excluded fields feature. Then, when you need them, you fetch them into the existing entity objects. See: http://www.llblgen.com/documentation/3.5/LLBLGen%20Pro%20RTF/hh_goto.htm#Using%20the%20generated%20code/Adapter/gencode_excludedfields_adapter.htm

Frans Bouma | Lead developer LLBLGen Pro