DataSet - incorrect rows count

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • EntryTeam
    New Member
    • Aug 2009
    • 55

    DataSet - incorrect rows count

    Count is about 67k, while phisycally there are only 2 records returned by query. What's going on? The cycle keeps returning those two records until exception or change in cycle condition.

    Code:
    for (int i = 0, c = ds.Tables[0].Rows.Count; i < c; i++) 
    {
    	values1[i] = ds.Tables[0].Rows[i]["column1"].ToString();
    	values2[i] = ds.Tables[0].Rows[i].Field<string>("column2");   
    }
  • Joseph Martell
    Recognized Expert New Member
    • Jan 2010
    • 198

    #2
    A massive duplication of the same 2 records sounds like the query needs tuning to me. It is possible to get duplicate records back, depending on your SQL. That would be the first place I would look.

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      That def sounds like an SQL issue, someone is selecting too much without restrictions and the result sets are getting multiplied.

      Comment

      Working...