Sebastian Claesson

Hi I am trying to use the QueryEx method to get a DataSet with my results instead of XML. Most of it works fine, i get a DataSet with the results in DataTables within the DataSet.

But the thing is that i don't get the TotalAvailable variable that i get if I would have done the same query with the Query-method.


Re: SharePoint - Search QueryEx problem

smc750

The TotalAvailable number can be obtained from the result table's extendedproperties collection under the key "TotalRows".

if (ds != null && ds.Tables.Contains("relevantresults"))
{
DataTable dt = ds.Tables["relevantresults"];
int totalRows = (int)dt.ExtendedProperties["TotalRows"];

}