How to read image/blob field with option strict on

P

Piedro

Hi group,

how do I read a image/blob field in cas option strict is on?
First I had it turned off and I read it like this:

Dim b() As Byte
If Not dsSupp.Tables(0).Rows(0).Item("BITMAP") Is DBNull.Value Then
b = dsSupp.Tables(0).Rows(0).Item("BITMAP")
end if

with option strict on this gives an error:
Option Strict On disallows implicit conversions from 'System.Object'
to '1-dimensional array of Byte'.

thnx in advance

Peter
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (Piedro) scripsit:
how do I read a image/blob field in cas option strict is on?
First I had it turned off and I read it like this:

Dim b() As Byte
If Not dsSupp.Tables(0).Rows(0).Item("BITMAP") Is DBNull.Value Then
b = dsSupp.Tables(0).Rows(0).Item("BITMAP")
end if

with option strict on this gives an error:
Option Strict On disallows implicit conversions from 'System.Object'
to '1-dimensional array of Byte'.

\\\
Dim abyt() As Byte = DirectCast(dsSupp.<...>.Item("..."), Byte())
///
 
P

Piedro

Hi,

thnx for the answers. But it seems I've got something going on with
posting a question
and then finding the answer a minute after I've posted my question. I
don't know why but it's happened
to me a few times before, that I can't find the solution to a question
and then a minute after I've posted the question I find it.
Now something I find amusing:
a colleague's opinion here at work is that for progamming you don't
need to be able think logical, but it's more important that you know
how to conjugate a language because that's what we do ?![]%!?
and yes he himself also is a programmer (but not a very good one, but
he's very close with the bosses...)

grtz Peter
 
C

Cor Ligthert

Piedro,

In my opinion there is for programming not "an" important quality, it is the
complex of those where some in the complex can be missed when there is an
equal result giving one.

One thing most of us have, is that when we have a problem for which we
cannot find the solution, it mostly helps when we write it on a paper with
the intention to make it clear to somebody else. (Or just try to tell it to
somebody else). Often we find than self the solution.

Good managers know this and help there employees with this, bad managers
tell than that they have given the solution, so the employee does that than
only once.

Just my thought

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top