Server Error in '/' Application.

This constraint cannot be enabled as not all values have corresponding parent values.

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.ArgumentException: This constraint cannot be enabled as not all values have corresponding parent values.

Source Error:


Line 61:                             ds.Tables("Homes").Columns("homeID"), ds.Tables("Home_Pictures").Columns("hp_homeID") _
Line 62:                         )
Line 63: 		ds.Relations.Add( _
Line 64:                             "Subs_Plats_relation", _
Line 65:                             ds.Tables("subdivisions").Columns("subdivisionID"), ds.Tables("Subdivision_Plats").Columns("sp_subdivisionID") _

Source File: D:\Inetpub\vhosts\kb-sales.com\httpdocs\subdivisions\SubDivisionDetails.aspx    Line: 63

Stack Trace:


[ArgumentException: This constraint cannot be enabled as not all values have corresponding parent values.]
   System.Data.ConstraintCollection.AddForeignKeyConstraint(ForeignKeyConstraint constraint) +1831151
   System.Data.ConstraintCollection.Add(Constraint constraint, Boolean addUniqueWhenAddingForeign) +413
   System.Data.DataSetRelationCollection.AddCore(DataRelation relation) +794
   System.Data.DataRelationCollection.Add(DataRelation relation) +153
   System.Data.DataRelationCollection.Add(String name, DataColumn parentColumn, DataColumn childColumn) +47
   ASP.subdivisions_subdivisiondetails_aspx.View_subdivisions(Object sender, EventArgs e) in D:\Inetpub\vhosts\kb-sales.com\httpdocs\subdivisions\SubDivisionDetails.aspx:63
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.WebControls.BaseDataList.OnLoad(EventArgs e) +45
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.8974; ASP.NET Version:2.0.50727.8975