Server Error in '/CongratsCards' 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 19:         '    CurrentCard = (From b In db.NewCollections Where b.IsDeleted = False And b.UniqueIdentity = Request.QueryString("ID2")).SingleOrDefault
Line 20:         'End If
Line 21:         Me.Title = "" + CurrentCard.CardName + " | بطاقات تهنئة جامعة تبوك"
Line 22: 
Line 23:         img = CurrentCard.ImageName

Source File: C:\inetpub\wwwroot\CongratsCards\pages\Card.aspx.vb    Line: 21

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   pages_Card.pages_Card_Load(Object sender, EventArgs e) in C:\inetpub\wwwroot\CongratsCards\pages\Card.aspx.vb:21
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +67
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1435


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