|
-
February 2nd, 2007, 07:36 AM
#1
Two Parent and one child DataRelation , Is it possible?
I have 3 tables [ tblItems , tblUser , tblUsage]
tblItem [ ItemId , Item Name , Description ]
tblUser [ UserId , UserFirstName , UserLastName ,........]
tblUsage[ ItemId , UserId , BeginDate , EndDate , ..........]
I need to create a relation of such tblUsage as child of two parents ( tblItem and tblUser ) but when i create its relation then it gives me error like "Cannot create a Key from Columns that belong to different tables."
Is it possible or not. . Any suggestions would be appreciated.
Thanks in Advance.
A Person who is polite is given goodness and a person who is away from Politeness is away from Goodness.
NAUMAAN
-
February 2nd, 2007, 09:22 AM
#2
Re: Two Parent and one child DataRelation , Is it possible?
The message seems to imply that the key for tblUsage is a combination of ItemId and UserId. Have you considered just having a uniqueId field for the key in tblUsage?
-
February 2nd, 2007, 09:37 AM
#3
Re: Two Parent and one child DataRelation , Is it possible?
Yes i have considered this, I did not want any UserId-ItemId pair duplicaton with unique Id combination.
A Person who is polite is given goodness and a person who is away from Politeness is away from Goodness.
NAUMAAN
-
February 2nd, 2007, 09:50 AM
#4
Re: Two Parent and one child DataRelation , Is it possible?
I realize that, but you can still enforce that without having to make it the primary key. Most of the SQL pros I know pretty much always make their primary key a unique Id and then use contraints to enforce data uniqueness.
-
February 2nd, 2007, 09:57 AM
#5
Re: Two Parent and one child DataRelation , Is it possible?
Thanks for your help , but i m quite ok with database design here. I have this issue at FrontEnd not on BackEnd. I m talking about DotNet System.Data.DataRelation.
A Person who is polite is given goodness and a person who is away from Politeness is away from Goodness.
NAUMAAN
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|