Send feedback on this topic.
Teradata.Client.Provider
BaseStream Property
Example 



Teradata.Client.Provider Namespace > TdBlob Class : BaseStream Property
Returns the underlying TdStream object.
Syntax
'Declaration
 
Public ReadOnly Property BaseStream As TdStream
'Usage
 
Dim instance As TdBlob
Dim value As TdStream
 
value = instance.BaseStream
public TdStream BaseStream {get;}
public:
property TdStream^ BaseStream {
   TdStream^ get();
}

Property Value

Specifies the underlying TdStream object, or a null reference (Nothing in Visual Basic) if the Advanced SQL Engine returns a null.
Exceptions
ExceptionDescription
The stream is null when the TdBlob is a DBNull.
The TdBlob is closed / disposed.
Remarks
The underlying TdStream can be used in conjunction with IO.BinaryReader to read primitive .NET data types from the BLOB.
Example
The following example returns the size of the employee picture. It builds on the example given in the TdBlob overview. There are more efficient ways to retrieve the BLOB size. For example, using SQL.
public void long GetEmployeePictureSize(String employeeId, TdConnection cn)
{
    long pictureSize = 0;
            
    // retrieve the picture
    TdBlob picture = GetEmployeePicture(employeeId, cn);
            
    if (false == picture.IsNull)
    {
        pictureSize = picture.BaseStream.Length;
    }
            
    // Close the TdBlob to release resources
    picture.Close();
            
    // return the size
    return pictureSize;
}
Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdBlob Class
TdBlob Members