Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Error handling.. please help

Author  Topic 

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-05-03 : 10:31:01
Hi all

I am binding a grid with a relation
i am getting the following eror

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

How can i get rid of this?
When i debugged, parent and child datacolumns have data in them
Then why is this happening
Can anyone please help to fix this?

Thank you very much

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-03 : 10:52:39
having data in them isn't enough.

every row in child table HAS to have a parent row in the parent table.

in your data not all child rows have parent rows.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-05-03 : 10:57:02
thanks
That means i have to fix my query, right?
Or is there anything other than that, to do in this??
Go to Top of Page

reflex2dotnet
Yak Posting Veteran

99 Posts

Posted - 2007-05-03 : 11:11:27
I fixed that
I put the same condition in child select also, and it worked

Thanks
Go to Top of Page
   

- Advertisement -