main table and dictionery table

  • Thread starter Thread starter yoramo
  • Start date Start date
Y

yoramo

Hello



It is difficult to explain my problem so please be patient with me.



I have 2 tables one is my main table and another is a dictionary table.

My dictionary table has 2 fields {ID, Name} (ID is PK)

My main table looks like that { MainID, MainName, DictID1, DictID2}

DictID1 & DictID2 - are integers pointing to the dictionary table.



my problem is that I need to display my main table in a DataGrid but the
DictID1&2 fields need to be the Name from dictionary table that corresponds
to the ID filed.



Can any one advice?





Thanks in advance

Yoramo
 
Hi yoramo,

You might add two expression columns to your main table where you put the
Name field based on DictId.
You would need two DataRelations, too, if you don't have them already.
 
Hello Miha

Sounds interesting can you point me to an example or article that will
elaborate more on this approach?

Yoramo
 
Hi yoramo,

About expression columns you can take a look at:
DataColumn.Expression .net help topic,

and for relations:
Relationships in ADO.NET Datasets.
 
Back
Top