By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,884 Members | 949 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,884 IT Pros & Developers. It's quick & easy.

DataSet - incorrect rows count

P: 55
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.

Expand|Select|Wrap|Line Numbers
  1. for (int i = 0, c = ds.Tables[0].Rows.Count; i < c; i++) 
  2. {
  3.     values1[i] = ds.Tables[0].Rows[i]["column1"].ToString();
  4.     values2[i] = ds.Tables[0].Rows[i].Field<string>("column2");   
Aug 10 '10 #1
Share this Question
Share on Google+
2 Replies

Joseph Martell
Expert 100+
P: 196
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.
Aug 10 '10 #2

Expert 5K+
P: 7,872
That def sounds like an SQL issue, someone is selecting too much without restrictions and the result sets are getting multiplied.
Aug 10 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.