Server Error in '/' Application.

Cannot perform runtime binding on a null reference

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: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot perform runtime binding on a null reference

Source Error:


Line 14:     var selectLocationString = "Select ConcertLocations.locationID, ConcertLocations.locationName, Concerts.concertID, Concerts.locationID FROM ConcertLocations INNER JOIN Concerts ON Concerts.locationID = ConcertLocations.locationID WHERE concertID = " + param;
Line 15:     var location = db.QuerySingle(selectLocationString, param);
Line 16:     var conLoc = location.locationName;    
Line 17:     var gig = db.Query("SELECT * FROM Concerts WHERE concertID = " + param);              
Line 18:     var listSql = "SELECT Playlists.concertID, Playlists.musicID, Playlists.sequence, Repertoire.musicID AS Expr1, Repertoire.name FROM Playlists INNER JOIN Repertoire ON Playlists.musicID = Repertoire.musicID WHERE Playlists.concertID = "+param+ " ORDER BY sequence";

Source File: d:\inetpub\vhosts\edriejk-3147.package\fridleycityband.org\wwwroot\Playlist.cshtml    Line: 16

Stack Trace:


[RuntimeBinderException: Cannot perform runtime binding on a null reference]
   CallSite.Target(Closure , CallSite , Object ) +115
   System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +660
   CallSite.Target(Closure , CallSite , Object ) +224
   ASP._Page_Playlist_cshtml.Execute() in d:\inetpub\vhosts\edriejk-3147.package\fridleycityband.org\wwwroot\Playlist.cshtml:16
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +69
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +143
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +116


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