Skip to content

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

@alexluozf

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions