Here ya go
Code that sets up the relationship
DataColumn parentCol;
DataColumn childCol;
parentCol = dsResults.Tables["People"].Columns["adminID"];
childCol = dsResults.Tables["Admins"].Columns["employeeID"];
DataRelation myRptRelation = new
DataRelation("AdminNames",parentCol,childCol,false );
dsResults.Relations.Add(myRptRelation);
Code that adds the column
//now add a NEW column that will populate the admin's name
DataColumn cName = new DataColumn();
cName.DataType = System.Type.GetType("System.String");
cName.ColumnName = "adminName";
cName.Expression = "Child.displayName" ;
dsResults.Tables["People"].Columns.Add(cName);
Thanks,
lee franke
"Prasad" <> wrote in message
news:%23jGj%...
> Hi
>
> Please post your code so that it will be easy to fix.
>
> Prasad
>
> "Lee Franke" <> wrote in message
> news:...
> > I'm trying to implement Child.ColumnName as in this example.
> >
> >
>
http://msdn.microsoft.com/library/de...us/cpref/html/
> frlrfsystemdatadatacolumnclassexpressiontopic.asp
> >
> > I am attempting to use the line.
> > DataColumn.Expresson = "Child.AdminName";
> >
> > I get the error "Cannot interpret token 'Child' at position 1".
> >
> > The DataRelation does exist.
> >
> > Has anyone done this successfully before?
> >
> > Thanks,
> >
> > lee franke
> >
> >
>
>