By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,929 Members | 1,245 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,929 IT Pros & Developers. It's quick & easy.

How to read image/blob field with option strict on

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
Piedro
b = directcast(dsSupp.Tables(0).Rows(0).Item("BITMAP") ,byte())


That is all

I hope this helps?

Cor
Nov 20 '05 #2

P: n/a
* 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

P: n/a
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

P: n/a
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.