0

I've got an Application(ASP.NET with C#) in which I get results from an database (the index from Microsoft Indexing Service) which I afterwards show in an asp:Repeater. Often I get the desired results for example the Repeater shows 1500 of 1500 results, but sometimes the query finds 300 Results and the Repeater shows only 200 of them.

This is how I get the number of result records:

foreach (DataTable dt in queryResult.Tables)
{

   foreach (DataRow row in dt.Rows)
   {
       rows++;
   }
}

This is how I bind the Data to the Repeater:

if (queryResult.Tables.Count > 0)
{
   Result.DataSource = queryResult;
   Result.DataBind();
}

Does anyone have any ideas what could cause this problem?

samoncode
  • 466
  • 2
  • 7
  • 23
  • 1
    [`DataTable.Rows`](http://msdn.microsoft.com/en-us/library/ms135388.aspx) has a property `Count`, so no need to enumerate all rows to calculate it. – Tim Schmelter Apr 24 '13 at 07:35
  • @TimSchmelter Ok. Thank you. But I still have to enumerate the tables and it doesn't explain why the Repeater sometimes doesn't show all results. – samoncode Apr 24 '13 at 07:43
  • Does your DataSet contain multiple tables? How do you want to calculate the row-count then? What does the repeater show, fields of a single table/resultset or fields of multiple tables/resultsets? – Tim Schmelter Apr 24 '13 at 07:46
  • @TimSchmelter Yes, the DataSet can contain multiple tables. to get the row-count I enumerate over all tables and add all the row-counts of the different tables. Since the DataSet contains the results of all tables the Repeater shows the results from all tables in one list. – samoncode Apr 24 '13 at 08:03

1 Answers1

0

Problem solved. It wasn't the Repeater but the Microsoft Indexing Service which filled up all the space on the HDD of the server and then wasn't able to return proper results. I moved the index to a partition with more space and everything works just fine.

samoncode
  • 466
  • 2
  • 7
  • 23