I have tried to write a general procedure for reading a
Sql server binary column into a C++ int array:
void ReadDataTableIntArray(
DataRow *prow, char *colname, int *iarr, int arrsize)
{
if ( !prow->IsNull( colname))
{
SqlBinary *sb = dynamic_cast<SqlBinary *>(prow-
>get_Item( colname)); // Generates exeption
System::Byte b[] = sb->get_Value();
ConvertGCToIntArray( iarr, b, arrsize);
}
}
How can this be done correctly?