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 13:         System.Data.SqlClient.SqlDataReader reader;
Line 14: 
Line 15:         using (var conn = new System.Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.AppSettings["DB_GALLERY"].ToString()))
Line 16:         {
Line 17:             cmd = new System.Data.SqlClient.SqlCommand("SET Transaction Isolation Level Read UNCOMMITTED; select top 1 threadid, subject from [peachyforum].[dbo].[cs_posts] where postid = '" + parentid + "'", conn);

Source File: c:\inetpub\wwwroot\PeachyForum\oldpeachyredirect.aspx    Line: 15

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   ASP.oldpeachyredirect_aspx.GetThreadId(String parentid) in c:\inetpub\wwwroot\PeachyForum\oldpeachyredirect.aspx:15
   ASP.oldpeachyredirect_aspx.Page_Load() in c:\inetpub\wwwroot\PeachyForum\oldpeachyredirect.aspx:5
   System.Web.UI.Control.OnLoad(EventArgs e) +107
   System.Web.UI.Control.LoadRecursive() +89
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1532


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