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 20: 
Line 21:     // Currency exchange
Line 22:     var current_currency = Request.Cookies["currency"].Value;
Line 23:     var currency = Request.Cookies["currency"].Value;
Line 24:     var currency_Data = dby.QuerySingle("select current_rate from currency_list where currency_name=@0", currency);

Source File: h:\root\home\admygnnet-001\www\hotelsinmyanmars\hotel\hotel-details.cshtml    Line: 22

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   ASP._Page_hotel_hotel_details_cshtml.Execute() in h:\root\home\admygnnet-001\www\hotelsinmyanmars\hotel\hotel-details.cshtml:22
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +199
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +73
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +154
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +80
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +119


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