'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