Home All Groups Group Topic Archive Search About
Author
17 Aug 2006 5:02 AM
manoj241176
Hi,
   I want to use DataRelation object for setting up relationship
between two different datatable, but i want to use multiple columns to
set up relation between two tables. For example.

DataRelation dRelationOrgInd = new DataRelation("OrgInd",
ds.Tables["OrgList"].Columns["iIDOrganization, iIDSeries"],
ds.Tables["IndList"].Columns["iIDOrganization, iIDSeries"], true);
        dRelationOrgInd.Nested = true;
        ds.Relations.Add(dRelationOrgInd);


I want to use something above mention code, but i am not able to set up
multiple columns in datarelation object for single table.

....I am using C# 2.0


Please tell me how can i achieve the same.


Thanks in advance.


Regards,
Manoj Singh.

Author
20 Aug 2006 7:43 PM
W.G. Ryan eMVP
There is an overloaded constructor that allows you to specify the name of
the relation and then the next two arguments are DataColumn Arrays.  You can
just create an array for the columns in the parent and the columns in the
child - passing in each array as the second and third arguments in the
DataRelation's constructor.

http://msdn2.microsoft.com/en-us/library/system.data.datarelation.datarelation.aspx
<manoj241***@gmail.com> wrote in message
Show quote
news:1155790946.716950.84100@p79g2000cwp.googlegroups.com...
> Hi,
>   I want to use DataRelation object for setting up relationship
> between two different datatable, but i want to use multiple columns to
> set up relation between two tables. For example.
>
> DataRelation dRelationOrgInd = new DataRelation("OrgInd",
> ds.Tables["OrgList"].Columns["iIDOrganization, iIDSeries"],
> ds.Tables["IndList"].Columns["iIDOrganization, iIDSeries"], true);
>        dRelationOrgInd.Nested = true;
>        ds.Relations.Add(dRelationOrgInd);
>
>
> I want to use something above mention code, but i am not able to set up
> multiple columns in datarelation object for single table.
>
> ...I am using C# 2.0
>
>
> Please tell me how can i achieve the same.
>
>
> Thanks in advance.
>
>
> Regards,
> Manoj Singh.
>

AddThis Social Bookmark Button