how to create the relations in c# classes

Posted by Mrsharepoint under C# on 8/5/2012 | Points: 10 | Views : 816 | Status : [Member] | Replies : 1
how to create one to one relations in c#,

and how to create one to many,



and explain what are the realtions in c#, it was there from beging c#,

Regards
Mr.Sharepoint.




Responses

Posted by: Megan00 on: 8/5/2012 [Member] Starter | Points: 25

Up
0
Down
Hi:
one to one:
suppose you have two classes: class1 and class2. you define a field in class1, the type of this field is defined to be class2. Then, you need to define the other field in class2, the type of this field is class1, then, you can create one to one relation in C#.

one to many:
define a field in class1, the field type should be defined to be an array. while the type of the array elements is class2. define a field in class2, the field type is class1. thus you can create one to many relations.

Never give up! Smile to the world!
http://excelcsharp.blog.com/

Mrsharepoint, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response