I am filtering a list in caml
SPQuery oQuery = new SPQuery();
oQuery.Query = "<OrderBy><FieldRef Name='FullName' /></OrderBy><Where><Contains><FieldRef Name='FirstName' /><Value Type='Text'>e</Value></Contains></Where>";
using (SPSite siteCollection = new SPSite("http://localhost/"))
{
using (SPWeb web = siteCollection.OpenWeb())
{
SPList oList = web.Lists["Profile"];
SPListItemCollection items = null;
oQuery.ViewFields = "<FieldRef Name='FullName'/>";
oQuery.RowLimit = 2;
items = oList.GetItems(oQuery);
if (items.Count > 0)
{
foreach (SPListItem item in items)
{
Console.WriteLine("Full Name: {0}",
item["FullName"]);
}
Console.WriteLine("Count: {0} | Count Query: {1} ",
items.Count,
items.List.ItemCount);
}
}
}
I'm using the SPListItemCollection.List.ItemCount, who is returning the value of 50 records. However records are 50 total items on my list, and I would like to know the total records on this list with the filter that actually are 22.
What is the best method to find this value? Thanks