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 4 1939
Piedro b = directcast(dsSu pp.Tables(0).Ro ws(0).Item("BIT MAP"),byte())
That is all
I hope this helps?
Cor
* 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(dsSu pp.<...>.Item(" ..."), Byte())
///
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: dave |
last post by:
Hello there,
I am at my wit's end ! I have used the following script succesfully to
upload an image to my web space. But what I really want to be able to do is
to update an existing record in a table in MySQL with the path & filename to
the image.
I have successfully uploaded and performed an update query on the database,
but the problem I have is I cannot retain the primary key field in a
variable which is then used in a SQL update...
|
by: Bob |
last post by:
Hello:
I've tried showing an image field from an MS SQL Server 2000 image field on
an ASP page but All I get is this
http://http://new.confectioneryhouse.com/glutenfree/about.asp
I added the content type and followed the many postings but no joy.
Here is my code. I'm using 2 pages.
|
by: zhaounknown |
last post by:
I have a field set to Image data type, and store a long string(possible other
objects)into it with size 5663, and returned with 5663+28 bytes.
These strings wil be deserialized after retrieving. However failde because
the bytes seems to include some extra bytes with \0 and 0x01 and have 28 more
bytes ahead of the original string.
How could I deal with it? Just remove the first 28 bytes? It this method
formal? I had thought the returned...
|
by: Roberto Castro |
last post by:
I have some problems with the way I am showing the BLOB fields in the
Image web controls. It does work on my localhost though sometimes I
need to hit Refresh for the images to load properly. However, when I
try to access the same page from another machine or when I test the
code on a remote server the images just wouldn't show.
The page I am talking about has 3 Image web controls. In the
CodeBehind I am loading these controls by using an...
|
by: jmhmaine |
last post by:
The following code works when Option Strict is off:
Dim thumbSize As New Size
thumbSize = CType(NewthumbSize(g.Width, g.Height, 100), System.Drawing.Size)
Dim imgThumbOutput As New Bitmap(g, thumbSize.Width, thumbSize.Height)
imgThumbOutput.Save(Server.MapPath(ThumbnailPath), thisFormat)
When I turn on Option Strict, I receive the following compile error:
Overload resolution failed because no accessible 'Save' can be called with
these...
| |
by: Luis Mendes |
last post by:
How can I read and write images to SQL server to a field with the type "image".
Can´t make DataBound work.
Thank's in advance,
Luis
|
by: =?Utf-8?B?ZGF2aWQ=?= |
last post by:
I try to follow Steve's paper to build a database, and store a small text
file into SQL Server database and retrieve it later. Only difference between
my table and Steve's table is that I use NTEXT datatype for the file instead
of using IMAGE datatype. I can not use SqlDataReader to read the data. I need
your help, Thanks.
-David
(1) I have a table TestFile for testing:
ID int
FileName navrchar(255)
|
by: theCancerus |
last post by:
Hi All,
I am not sure if this is the right place to ask this question but i am
very sure you may have faced this problem, i have already found some
post related to this but not the answer i am looking for.
My problem is that i have to upload images and store them. I am using
filesystem for that.
setup is something like this, their will be items/groups/user each can
|
by: Icemokka |
last post by:
Hi,
I'm need to upload a big file ( 600Mb+ ) to a BLOB field in MSSQL
2005.
My code looks like this :
fs = New FileStream(sFilePath, FileMode.Open)
Dim ByteArray(fs.Length) As Byte
fs.Read(ByteArray, 0, fs.Length)
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |