I need to query a list in SharePoint where the columns may be added in the future. For instance at the moment I have the following columns Name, Job, interests, address I want to be able to query this string dynamically using a parameter from the browser so if columns are added in the future I don’t have to change the code but just the parameter. The address may look like this www.contoso.com/sites/mypage.aspx?property=Interests And the code something on the line of this:
var SiteParameter = Request.QueryString["property"];
var ItemsFromList = from item in ListItems where item[try to put the parameter in here] select item;
I use SPmetal to get the list details, so if I press item. Visual Studio2010 will return the columns within the list.