Skip to content

Unable to read binary data stored in VARBINARY (n) type fields #1258

Description

@alexluozf

Hello,
Unable to read binary data stored in field BlockData VARBINARY (32,765) .

SortedDictionary<short, byte[]> result = [];
foreach (DataRow dataRow in dataTable.Rows)
{
if (dataRow["BlockNo"] is not short blockNo) { continue; }
object objVal = dataRow["BlockData"];
if(objVal is not byte[] blockData) { continue; }
//if (dataRow["BlockData"] is not byte[] blockData) { continue; }
result[blockNo] = blockData;
}
The value of objVal is always the string 'System. Byte []', the value of blockData is always the null.

Thanks a lot.
Alex

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions