0

I had used CrossListQueryInfo to get the large amount of items from lists. When I am trying to use the object of CrossListQueryCache I am facing below error.

Can anyone help me what's the issue and why I am unable to call the object of CrossListQueryCache

enter image description here

1

You need to iterate using DataRow inside a Datatable.

You cannot use SPListItem to iterate inside a datatable as its incorrect.

The object model to use Datatable is DataTable -> DataRowCollection -> DataRow where you use the DataRow to look for contents inside a column of a row

Code would be somewhat as below:

foreach(DataRow row in results.Rows)
{
    //if you want to use column name, try the below line of code.
    var title = Convert.ToString(row["Title"]);

    //if you want to use index, try the below line of code.
    //var title = Convert.ToString(row[0]); 
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.