开发者

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";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜