62,046
社区成员
发帖
与我相关
我的任务
分享
int[] leafs = new[]{4,5,6,7}; //叶子节点数组。
string leafs_str = "4,5,6,7";
string sql = "select * from A where id not in ("+leafs_str+")";
//这样查询出来的结果就不会有叶子,你再绑定就可以了?
//如果用LINQ,查询更简单。
var q = from a in As where !leafs_str.Contains(a.id);