Server Error in '/' 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 24:             con.Open()
Line 25:             Dim file() As Byte = CType(cmd.ExecuteScalar(), Byte())
Line 26:             context.Response.BinaryWrite(file)
Line 27:         End Using
Line 28:         'context.Response.Write("Error")

Source File: C:\WEBSITES\PRODUCTION\Resources\BulletinHandler.ashx    Line: 26

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   System.Web.HttpResponse.BinaryWrite(Byte[] buffer) +16
   BulletinHandler.ProcessRequest(HttpContext context) in C:\WEBSITES\PRODUCTION\Resources\BulletinHandler.ashx:26
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +188
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +48
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +71


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3930.0