TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
nguyenvantin
NA
1
0
Set the DataSet Relations
May 23 2004 10:56 PM
hi all, I have a dataset with 5 tables: tb_Projects(pk_ProjectID,name,...) tb_Donors(pk_DonnorID,name,...) tb_Clients(pk_ClientID,code,name,...) tb_ProjectDonors(pk_ProjectDonorID,fk_projectID,fk_DonnorID) tb_ProjectClients(pk_ProjectClientID,fk_ClientID,fk_ProjectID). And the code, i set the Relation as below: ds.Relations.Add( "ProjectProjectDonors", ds.Tables["Projects"].Columns["pk_ProjectID"], ds.Tables["ProjectDonors"].Columns["fk_ProjectID"]); ds.Relations.Add( "ProjectDonors", ds.Tables["ProjectDonors"].Columns["fk_DonnorID"], ds.Tables["Donors"].Columns["pk_DonnorID"]); ds.Relations.Add( "ProjectProjectClients", ds.Tables["Projects"].Columns["pk_ProjectID"], ds.Tables["ProjectClients"].Columns["fk_ProjectID"]); ds.Relations.Add( "ProjectClients", ds.Tables["ProjectClients"].Columns["fk_ClientID"], ds.Tables["Clients"].Columns["pk_ClientID"]); But in the runtime the system shows error "This constraint cannot be enabled as not all values have corresponding parent values" at the row : ds.Relations.Add( "ProjectClients", ds.Tables["ProjectClients"].Columns["fk_ClientID"], ds.Tables["Clients"].Columns["pk_ClientID"]); Please help me to fix this. Thanks, Tin Nguyen
Reply
Answers (
1
)
ComboBox help
PRINT PREVIEW HELP