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 14:         context.Response.ContentType = "text/plain";
Line 15:         SqlConnection con = objUtils.OpenConnection();
Line 16:         string mediaFileName = Convert.ToString(SqlHelper.ExecuteScalar(con, CommandType.Text, "SELECT mediafile FROM SOUNDBOARD WHERE id=" + context.Request["fileId"].ToString(), null));
Line 17:         context.Response.Write(mediaFileName);
Line 18:     }

Source File: e:\Inetpub\soundboard\web\sb\hndGetRawFile.ashx    Line: 16

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   hndGetRawFile.ProcessRequest(HttpContext context) in e:\Inetpub\soundboard\web\sb\hndGetRawFile.ashx:16
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433