Home All Groups Group Topic Archive Search About

Extracting Image from SQL Server

Author
3 Sep 2005 4:43 PM
xactdata
I am currectly extracting an image field type from a SQL Server table using...

dr is an OleDataReader object

Byte b[] = __gc new Byte[Convert::ToInt32((dr->GetBytes(0, 0, 0, 0,
Int32::MaxValue)))];
dr->GetBytes(0, 0, b, 0, b->Length);

This works fine on a test database with images that are just , but the
particular db I am trying to process has the image field in WMF format. When
I try to extract it from the SQL Server db using the code above I get a Cast
Exception error.

Any help??

Thanks,
Rod

AddThis Social Bookmark Button