Determine BLOB SIZE through datareader
I want to execute a datareader with blobs in it. I can do this if I know how big the blobs are and allocate a byte[] that is larger (using .GetBytes()) However, I don't always know how big that is. The database type has a limit, but for an MSSQL image field, it is 2GB (I think). I can't allocate that, so I need to know the actual size of the BLOB data.
How can I use the SqlDataReader to determine the size of a blob on a particular row so that I can allocate a big enough byte[] for it?
I'd post some code, but I'm actually doing this in Delphi, not C#, and I don't want to get caught up in tangential arguments.
Thanks!