Hi All -
I have a very simple question, but hard to understand for me. I am trying to create a database application in C# (Winforms).I have a database in Visual Studio. In the DataSet I created relationships. Now, in my Data Source when I expand a table I see another table inside it, and I can expand that table too.
The confusion I am having - All 4 tables are connected in one way or another and when you expand a table there is a table that resides in that table, however, the nested table also resides in other table. How do I know which table to use when I drag the column onto the form?
Can anyone point me to where I can learn exactly how the tables are assigned in the Data Source and when the relationship is created - how do you know which table to use on the forms?
I hope this makes sense.
Update to question:
Thanks for the replies. Yes, the relationships are very obvious to me since I created them. However, not sure if I am doing it the best way, but after I create the relationships - I always drag the fields from the Data Source Window over to the form, and that creates the Binding Source and Navigator.
Before I create the relationships:
tblClient
ClientID
FirstName
LastName
tblFile
FileID
ClientID
FileNumber
FileDate
tblReceipts
ReceiptID
FileID
ReceiptNumber
ReceiptDate
tblCoSigner
CoSignerID
ReceiptID
CoFirstName
CoLastName
Then my relationships look like this:
tblClient - tblFile (1 to many)
tblFile - tblReceipts (1 to many)
tblReceipts - tblCoSigner (1 to many)
After the relationships the Data Source Window now has:
Client Table
ClientID
FirstName
LastName
-tblFile
FileID
CleintID
FileNumber
Date
-tblReceipts
ReceiptID
FileID
ReceiptNumber
-tblCosigner
CosignerID
ReceiptID
CoFirstName
CoLastName
tblFile
FileID
ClientID
FileNumber
Date
-tblReceipts
ReceiptID
FileID
ReceiptNumber
-tblCoSigner
CosignerID
ReceiptID
CoFirstName
CoLastName
So with the above, you see how tblCoSigner was placed in two different tables, as well as, outside of the table. Also, the other tables are placed inside other tables that there is a relationship with. When I drag a column over to the form to create the binded text box, how do I know for sure which ones are going to use the relationship when they are a child of several other parent tables.
Hope this make sense in trying to make this easier for you.
What I have tried:
google and trying to figure it out myself.