Multi-relational tables in a dataset....

R

rmorvay

I have three tables in a dataset that I need to relate. I know how to
relate two tables but going beyond that is, quite frankly, beyond me. Any
insight? Here is the C# code that I did for a two table relate. I need to
relate TerritoryExceptionColumns as well:

DataColumn[] TerritoryColumns;
DataColumn[] TerritoryExceptionTypeColumns;
DataColumn[] TerritoryExceptionColumns;

TerritoryColumns = new DataColumn[]
{dsTerritory2.Tables["Territory"].Columns["TerritoryID"],
dsTerritory2.Tables["Territory"].Columns["ExceptionType"]};

TerritoryExceptionTypeColumns = new DataColumn[]
{dsTerritory2.Tables["TerritoryExceptionType"].Columns["TerritoryID"],
dsTerritory2.Tables["TerritoryExceptionType"].Columns["ExceptionType"]};

TerritoryExceptionColumns = new DataColumn[]
{dsTerritory2.Tables["TerritoryException"].Columns["TerritoryID"],
dsTerritory2.Tables["TerritoryException"].Columns["ExceptionType"]};

DataRelation drelTerritory = new DataRelation("Territory",
TerritoryColumns, TerritoryExceptionTypeColumns);
dsTerritory2.Relations.Add(drelTerritory);

Thanks in advance.
 
R

rmorvay

Is this somthing that can't be done or maybe I didn't explain my problem
well enough? I am in a crunch mode so any assistance would greatly be
appreciated.

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top