Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread Graphic Datatype
Sat, Aug 5 2006 5:41 AMPermanent Link

Suman Sundar
Hi Tim,

The table of DBISAM Consists of columns with graphic datatypes. I cound't retreive the image from the column and display in ASP.NET. Please kindly
solve this issue.

Suman Sundar
Sun, Aug 6 2006 4:24 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Suman


How about a bit more info for Tim - version, what you mean by "I cound't retreive the image from the column" and how you're attempting to do so.

Roy Lambert
Sun, Aug 6 2006 5:03 AMPermanent Link

Suman Sundar
I coudn't read Blob files with ANSI format and Graphic datatype in ASP.NET. Please kindly advise me.

Suman Sundar

Sun, Aug 6 2006 8:12 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Suman


I presume you're using the ODBC driver - yes / no?

What code are you using to read the data?

Roy Lambert
Mon, Aug 7 2006 2:21 AMPermanent Link

Suman USNdar
Hi Roy,

I can view the embed image from the table through DBISAM but I coun't retreive through ASp.NET. I have mentioned the code.

Dim objOdbcConnection As New OdbcConnection("DSN=System")
       Dim objOdbcCommand As New OdbcCommand

       objOdbcCommand.Connection = objOdbcConnection
       objOdbcCommand.CommandType = CommandType.Text
       objOdbcCommand.CommandText = "select 'Company Logo' from sysProperties"
       objOdbcCommand.Connection.Open()

       Dim dr As OdbcDataReader = objOdbcCommand.ExecuteReader()
       While dr.Read()
           Response.BinaryWrite(dr.Item(0))
       End While

Exception

Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.  

Stack Trace:


[InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'.]
  UI.MyIncident.Page_Load(Object sender, EventArgs e) in \\dxbafpww16\sentinelcs\dev1\UI\Forms\MyIncident.aspx.vb:39
  System.Web.UI.Control.OnLoad(EventArgs e) +99
  System.Web.UI.Control.LoadRecursive() +47
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42


suman sundar

----------

Roy Lambert <roy.lambert@skynet.co.uk> wrote:

Suman


I presume you're using the ODBC driver - yes / no?

What code are you using to read the data?

Roy Lambert
Mon, Aug 7 2006 3:33 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Suman


That's way out of my knowledge (I've never used .NET) but hopefully there's enough info there now for someone t help you.

Roy Lambert
Mon, Aug 7 2006 4:28 AMPermanent Link

"Frans van Daalen"

"Suman USNdar" <sundrarajan.suman@emirates.com> wrote in message
news:16CF16CF-3C48-45E1-87B6-01EFDEE83878@news.elevatesoft.com...
> Hi Roy,
>
> I can view the embed image from the table through DBISAM but I coun't
> retreive through ASp.NET. I have mentioned the code.
>
> Dim objOdbcConnection As New OdbcConnection("DSN=System")
>        Dim objOdbcCommand As New OdbcCommand
>
>        objOdbcCommand.Connection = objOdbcConnection
>        objOdbcCommand.CommandType = CommandType.Text
>        objOdbcCommand.CommandText = "select 'Company Logo' from
> sysProperties"
>        objOdbcCommand.Connection.Open()
>
>        Dim dr As OdbcDataReader = objOdbcCommand.ExecuteReader()
>        While dr.Read()
>            Response.BinaryWrite(dr.Item(0))
>        End While
>
> Exception
>
> Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
>
> Exception Details: System.InvalidCastException: Unable to cast object of
> type 'System.DBNull' to type 'System.Byte[]'.
>
>
I have no knowledge of .net but is DBNull not a warning that the field is
not filled or beter not initialised?


Mon, Aug 7 2006 3:07 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Suman,

<< I can view the embed image from the table through DBISAM but I coun't
retreive through ASp.NET. I have mentioned the code. >>

Is there actual data in the BLOB field that you're trying to access ?

Did you try something like this instead ?

http://support.microsoft.com/default.aspx?scid=kb;en-us;326502

--
Tim Young
Elevate Software
www.elevatesoft.com

Image