This documentation is archived and is not being maintained.

OracleBFile.Seek Method

Sets the position on the current OracleBFile stream.

Namespace:  System.Data.OracleClient
Assembly:  System.Data.OracleClient (in System.Data.OracleClient.dll)

'Declaration
Public Overrides Function Seek ( _
	offset As Long, _
	origin As SeekOrigin _
) As Long
'Usage
Dim instance As OracleBFile 
Dim offset As Long 
Dim origin As SeekOrigin 
Dim returnValue As Long 

returnValue = instance.Seek(offset, origin)

Parameters

offset
Type: System.Int64

A byte offset relative to origin. If offset is negative, the new position will precede the position specified by origin by the number of bytes specified by offset. If offset is zero, the new position will be the position specified by origin. If offset is positive, the new position will follow the position specified by origin by the number of bytes specified by offset.

origin
Type: System.IO.SeekOrigin

A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position.

Return Value

Type: System.Int64
The new position within the current stream.

ExceptionCondition
ArgumentOutOfRangeException

Attempted to set a position with a negative value or greater than the length of the stream.

ObjectDisposedException

Methods were called after the stream was closed or disposed.

If offset is negative, the new position is required to precede the position specified by origin by the number of bytes specified by offset. If offset is zero, the new position is required to be the position specified by origin. If offset is positive, the new position is required to follow the position specified by origin by the number of bytes specified by offset.

Seeking to any location beyond the length of the stream is not supported.

Any attempt to access a closed OracleBFile using the Read or Seek methods reopens an OracleBFile stream automatically.

The following C# example assumes this schema in an Oracle table:

(col1 number, col2 BFILE)

The example demonstrates using the Read and Seek methods to access an OracleBFile object.

byte[] buffer = new byte[100];
OracleDataReader dataReader = command.ExecuteReader();
using (dataReader) {
    if (dataReader.Read()) {
            OracleBFile BFile = dataReader.GetOracleBFile(1);
        using (BFile) {
            BFile.Seek(0, SeekOrigin.Begin);
            BFile.Read(buffer, 0, 100);
        }
    }
}

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1
Show: