i have a problem with showing my text file contetnt in listview.
i have about 200 text files with some client informations in it, each file is 1 client
there are 6 rows. and i want each row in each file to be listet in list view.
my listview is 6 columns .
i want it to look like this
| col1 | col2 | col3 | col4 | col5 | col6 |
| row1 | row2 | row3 | row4 | row5 | row6 |
kevin bredahlPosted Feb 27, 2014, 2:01 AM
but i says "use of unassigned local variable 'co1 - co6'"
how can i fix that
VulpesPosted Feb 26, 2014, 6:08 PM
using System.IO;
//...
listView1.BeginUpdate();
foreach(string filePath in filePaths)
{
string[] rows = File.ReadAllLines(filePath);
ListViewItem lvi = new ListViewItem(rows);
listView1.Items.Add(lvi);
}
listView1.EndUpdate();
EDIT
As you've closed the thread, I can only answer your second post by editing this post.
Anyway, the answer is to initialize your variables to empty strings: