Server Error in '/institucional' Application.

Parameter is not valid.

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.ArgumentException: Parameter is not valid.

Source Error:


Line 46:         Else
Line 47:             Dim bin As Oficina.BLL.REES.Institucional.Imagem = New Oficina.BLL.REES.Institucional.Imagem(opcaoId)
Line 48:             imagem = New Oficina.Drawing.Image(bin.CampoImagem)
Line 49:             imagem.Bitmap.Save(Server.MapPath("~/style/imagesDb/" & opcaoId & ".jpg"))
Line 50:         End If

Source File: E:\SITES\JOAOFORTES240\Root_www.joaofortes.com.br\institucional\Handler\ImagemDB.ashx    Line: 48

Stack Trace:


[ArgumentException: Parameter is not valid.]
   System.Drawing.Bitmap..ctor(Stream stream) +612689
   Oficina.Drawing.Image..ctor(Byte[] Bitmap) +99
   ImagemDB.ProcessRequest(HttpContext context) in E:\SITES\JOAOFORTES240\Root_www.joaofortes.com.br\institucional\Handler\ImagemDB.ashx:48
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171


Version Information: Microsoft .NET Framework Version:2.0.50727.8009; ASP.NET Version:2.0.50727.8015