469,904 Members | 1,921 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

How to read image/blob field with option strict on

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
Nov 20 '05 #1
4 1775
Piedro
b = directcast(dsSupp.Tables(0).Rows(0).Item("BITMAP") ,byte())


That is all

I hope this helps?

Cor
Nov 20 '05 #2
* pp*****@hotmail.com (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())
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 20 '05 #3
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
Nov 20 '05 #4
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

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

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by dave | last post: by
2 posts views Thread by zhaounknown | last post: by
4 posts views Thread by jmhmaine | last post: by
2 posts views Thread by Luis Mendes | last post: by
3 posts views Thread by =?Utf-8?B?ZGF2aWQ=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.