Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to Display results of the list .
Is it possible to display the list in console (program is windows form)as list excludedNames has many values. Which is the best way to display the result.?.

private void bt_compare_Click(object sender, EventArgs e)
        { 
            
                           
          table1 = GetDataTabletFromCSVFile(tbCSVPath.Text);

          table2 = GetDataTabletFromCSVFile1(tbCSVPath1.Text);
           
       
            List<string> excludedNames = new List<string>();
            
            for (int i = 0; i < table1.Rows.Count; i++)
            {
                string col = table1.Rows[i]["Par Name"].ToString();
                if (!table2.Columns.Contains(col))
                {
                   excludedNames.Add(col);
                   
                }


            } 
            
          

           
        
        }
Posted
Updated 24-Mar-14 3:14am
v2

1 solution

In a console, you don't get a lot of options: Console.WriteLine is pretty much your lot:
C#
foreach (string s in excludedNames)
   {
   Console.WriteLine(s);
   }
 
Share this answer
 
Comments
FarhanShariff 24-Mar-14 9:16am    
can i use this in windows form
FarhanShariff 24-Mar-14 9:17am    
what are the other best options
OriginalGriff 24-Mar-14 9:32am    
Personally?
I'd add a DataGridView to your form, and set its DataSource property to the list directly. It' will then display the list for you.
But...if there are that many entries, you might want to look at adding a DataView and letting the user filter the DataGridView to make it easier to find what they are looking for - google will show you how.

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