"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;
精彩评论