开发者

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

开发者 https://www.devze.com 2023-04-02 07:10 出处:网络
\"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

"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

精彩评论

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