-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Read an image With Nhibernate from SQL SERVER DB
PostPosted: Fri Sep 02, 2005 6:05 am 
Newbie

Joined: Fri Sep 02, 2005 5:52 am
Posts: 1
Dear all,

I wan to read an image from the database via NHibernate.

The description in the XML Files is
Code:
<property name="_Image" type="BinaryBlob"  olumn="img_catalog_picture" access="field"/>


In my VB.NET class, the declaration is

Code:
Public Property Image() As System.Drawing.Image
           Get
                If Not IsNothing(_Image) Then
                    Dim tmpMemoryStream As System.IO.MemoryStream = New System.IO.MemoryStream(_Image)
                    Dim tmpImage As System.Drawing.Image
                   Return tmpImage.FromStream(tmpMemoryStream)
                Else
                    Return Nothing
                End If
            End Get


I can't read the image because I Have the following error message:

Exception Text:
Quote:
NHibernate.ADOException: problem in find ---> System.ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds.


Someone can help me please ?

Thanks in advance

_________________
Hummer


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.