开发者

DataView rowfilter with 2 levels of parents

开发者 https://www.devze.com 2023-01-28 07:54 出处:网络
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

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

精彩评论

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