Server Error in '/' Application.

The 'Player2ID' property on 'MatchResult' could not be set to a 'null' value. You must set this property to a non-null value of type 'System.Int32'.

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.Data.ConstraintException: The 'Player2ID' property on 'MatchResult' could not be set to a 'null' value. You must set this property to a non-null value of type 'System.Int32'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[ConstraintException: The 'Player2ID' property on 'MatchResult' could not be set to a 'null' value. You must set this property to a non-null value of type 'System.Int32'. ]
   System.Data.Entity.Core.Common.Internal.Materialization.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal) +96
   lambda_method(Closure , Shaper ) +697
   System.Data.Entity.Core.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly(Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet) +185
   lambda_method(Closure , Shaper ) +313
   System.Data.Entity.Core.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper) +182
   System.Data.Entity.Core.Common.Internal.Materialization.SimpleEnumerator.MoveNext() +87
   System.Data.Entity.Internal.LazyEnumerator`1.MoveNext() +112
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +246
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +54
   OpenEraRankings.App_Start.DrawData.BuildCalendarYear(Int32 year, Int32 month, Int32 maintour, Int32 tour, SessionUser& su) in C:\Users\Girraphic\source\repos\marrmarv\OpenEraRankings\OpenEraRankings\App_Start\DrawData.cs:4126
   OpenEraRankings.Draws.Page_Load(Object sender, EventArgs e) in C:\Users\Girraphic\source\repos\marrmarv\OpenEraRankings\OpenEraRankings\Draws.aspx.cs:457
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +85
   System.Web.UI.Control.OnLoad(EventArgs e) +79
   System.Web.UI.Control.LoadRecursive() +130
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2853


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