Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

I got this problem, the programe that am busy with gets customers details from one unique identifier being the email address.
Now when I want to display the data on a data grid it only shows the two rows which are duplicate.

This is what am doing:

C#
int _lineItem = 0;
  int _insertCount = 0;
  string[] _line = values;
  int tabcount = _line.Length;
  //string[] _mail_cnt = myEmails;
  for (int ii = 0; ii < myEmails.Count; ii++)
    if (_line.Length > 0)
    {
      dtOutput.Rows.Add(new object[] {
        _line[0].ToString(),
        _line[1].ToString(),
        _line[2].ToString(),
        _line[3].ToString(),
        _line[4].ToString(),
        _line[5].ToString(),
        _line[6].ToString() 
      });
      imported++;
    }
  _lineItem++;
  _insertCount++;


Please can you assist?
Posted
Updated 8-Sep-10 23:01pm
v3
Comments
Sandeep Mewara 9-Sep-10 4:47am    
What is 'values' that is defining '_line' ?
Sandeep Mewara 9-Sep-10 4:52am    
Update from OP: values, is where all the values have been stored from the array list.
Dalek Dave 9-Sep-10 5:02am    
Minor Edit for Grammar.

1 solution

Your logic to populate the grid data depends on two things here... Email Count and Values count...

If it show 2 duplicate rows only then there is some problem with the values. You need to look there.

A simple use of DEBUGGER can tell you what and where things are going wrong.
Last thing, there could had been a cleaner way to do what you are trying. Also, try to keep a meaningful names of variable, that increases readability of code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900