开发者

Constructing a linq query with dynamic ListItem columns that are type boolean

"selectedBA" is the variable that contains a value determ开发者_开发百科ined @ runtime. how can i incorporate this into a linq statement that will give me all the items in a SPList where the dynamic column selectedBA is True in the item. Probably something simple i am over thinking... the dynamic column is Type Boolean in the SPList

DataTable dt = siteTemplateList.GetItems().GetDataTable();
var query = from template in dt.AsEnumerable()
            where template[selectedBA].Equals(true)
            select template;


try

DataTable dt = siteTemplateList.GetItems().GetDataTable();
var query = from template in dt.Rows
            where template[selectedBA].Equals(true)
            select template;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜