Good morning all,
I just wanted to post this for posterity. I had a hard time finding an old post I saw by Jose talking about how ttResults was replaced by a dataset reference. I had to update some old code and couldn’t find the post.
Do you get an error “ttResults does not exist in the current context.”?
Just replace ttResults with queryResultDataset.Results.
In my code it was:
foreach (var ttResults_iterator in (from ttResults_Row in ttResults where ttResults_Row.Unchanged() select ttResults_Row))
and I updated it to:
foreach (var ttResults_iterator in (from ttResults_Row in queryResultDataset.Results where ttResults_Row.Unchanged() select ttResults_Row))
Yup… things have changed…
ALSO… you should consider changing your line to be “better” for the system.
You currently have:
foreach (var ttResults_iterator in (from ttResults_Row in queryResultDataset.Results where ttResults_Row.Unchanged() select ttResults_Row))
but to make the system more efficient with the data, and to make this more readable, you should do the following:
do the query and get the results
THEN do the foreach on the results.
Like this:
var myResults = queryResultDataset.Results.Where(x=>x.Unchanged());
foreach (var result in myResults) {
//do your work here
}
Reason? From what I am told, when you have the query built into the foreach, it leaves the query open and is retrieving inefficiently… but when you do the one query first, it is faster. Also, (in my opinion) this is easier to read.(I hate that old “Iterator” variable)