DataView rowfilter with 2 levels of parents
How can I create DataView rowfilter with two levels of parent relations?
Within one level, I can do something like: "Parent(NameOfTheRelation).id_Something = " + 17
However, with 2 levels I don't know what to do?
Can anyone he开发者_如何学Pythonlp shed some light on what I can try next?
Define an expression column on the parent table...
DataTable dtGrandParent, dtParent, dtChild;
DataColumn dataColumn = new DataColumn("SomeField");
dataColumn.Expression = "Parent(NameOfParentToGrandParentRelation).SomeField";
dtParent.Columns.Add(dataColumn);
DataView dv = new DataView(dtChild);
dv.RowFilter = "Parent(NameOfChildToParentRelation).SomeField";
精彩评论