Click or drag to resize

IDatabaseExtractorExtractTableAsText Method

Extracts the table as formatted text to the supplied stream. See remarks.

Namespace: OpenDiscoverSDK.Interfaces.Extractors
Assembly: OpenDiscoverSDK.Interfaces (in OpenDiscoverSDK.Interfaces.dll) Version: 2025.4.4.0 (2025.4.4)
Syntax
C#
void ExtractTableAsText(
	TableInfo table,
	Stream textOutputStream,
	int rowStart = 0,
	int rowEnd = 500000
)

Parameters

table  TableInfo
The table to extract text.
textOutputStream  Stream
Output stream to write extracted table text. Internally, this stream gets wrapped by a TextWriter stream so this argument stream should be a FileStream or MemoryStream. Caution: Do not use a MemoryStream unless you set arguments 'rowStart' and 'rowEnd' appropriatedly as some database formats can have 10's of millions of rows and the in-memory MemoryStream will get extremely large and may cuase application memory issues.
rowStart  Int32  (Optional)
The zero-offset starting row position to write to the 'textOutputStream' argument. This value must be less that 'rowEnd' argument and less the number of table rows.
rowEnd  Int32  (Optional)

The ending zero-offset table row number of table to output (default value is the first 500,000 rows of a table).

If the actual number of table rows is less than 'rowEnd', then the last zero-offset row number will be used.

A value of zero for 'rowEnd' will cause only the table name and column names to be written to stream.

A value less than zero will cause all table rows from 'rowStart' position to last row number to be written to the stream. NOTE: some database formats can have 10's of millions of rows so it is up to the user to determine if they want all table rows outputted to stream.

Remarks

For supported Microsoft Access database formats 'rowStart' and 'rowEnd' are ignored and the whole table is written to the stream. All other supported database formats honor the 'rowStart' and 'rowEnd' arguments.

This method will write out the table name and columns names to stream argument and then the rows specified by arguments 'rowStart' and 'rowEnd'.

Table binary array columns are not exported by this method. Binary columns will have place holder text inserted for column row values. To extract a table's binary column values see method EnumerateTableRows(TableInfo, ListInt32).

See Also