Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 23rd, 2005, 04:31 PM
Authorized User
 
Join Date: Aug 2003
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem retreivig image from file stream

'Call Webservice to pass 3 parameters

Dim WS As New ImageRetreival.WS1.GetImage

Dim ImageDB As Byte()

'Dim d As System.Text.Encoding

' ImageDB(0) = WS.RetreiveImageDB(userid, patientid, recordid)

Dim ImgDbstr As String = WS.RetreiveImageDB(userid, patientid, recordid)

'btyes = Convert.FromBase64String(string)

ImageDB = Convert.FromBase64String(ImgDbstr)

Dim ms As New System.IO.MemoryStream(ImageDB)

Dim img As System.Drawing.Image

img.FromStream(ms)

img.Save(Server.MapPath("filename"))

img.Dispose()

ms.Close()

ms.Flush()


This is my error messsage:



Server Error in '/ImageRetreival' Application.
--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 77: Dim img As System.Drawing.Image
Line 78: img.FromStream(ms)
Line 79: img.Save(Server.MapPath("filename"))
Line 80: img.Dispose()
Line 81: ms.Close()


Source File: C:\Inetpub\wwwroot\ImageRetreival\image.aspx.vb Line: 79

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   ImageRetreival.image.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\ImageRetreival\image.aspx.vb:79
   System.Web.UI.Control.OnLoad(EventArgs e)
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Page.ProcessRequestMain()






Sanjeet
__________________
Sanjeet





Similar Threads
Thread Thread Starter Forum Replies Last Post
File stream Gridview to Excel yukijocelyn ASP.NET 2.0 Professional 0 October 1st, 2007 01:10 AM
reading a stream from all the lines of a file vaidyapragati ASP.NET 2.0 Basics 3 May 10th, 2007 02:33 AM
xml binary file to ADO stream clk1022 XML 1 March 17th, 2006 03:33 PM
displaying an image from file stream into an image sanjeet ADO.NET 0 September 23rd, 2005 10:28 AM
Adodb.stream File could not be opened. irabba Javascript 6 July 6th, 2004 06:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.