I am trying to use Dynamic Linq library in my code, but it gives this error
‘UserId’ could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are referenced correctly. Near simple identifier, line 6, column 1
and here is my code
TestDB db = new TestDB();
string filter = "UserId == 15";
//var searchResult =
GridView1.DataSource = from x in db.SearchSummaries.Where(filter)
select x;
GridView1.DataBind();
Not so familiar with dynamic Linq but from your error message:
Please try this:
1.) Is the column UserId a Integer and not a String? Mabye you need to use:
2.) Try to pass in the filter parameter as a second argument:
3.)
I don’t know if you are able to run “regular” Linq queries, but if you are, try: