I'm using Visual C# 2010 Express. I have an Array of strings like this arr[100][2]. Here's my 3 lines of code
string FilePath = @"c:\data.txt";
var arrData = File.ReadLines(FilePath).Select(line => line.Split('\t')).ToArray();
dataGridView1.DataSource = arrData;
When I run the code I see 7 column headers in the DataGridView control instead of the contents of my array: Length, LongLength, Rank, SyncRoot, IsReadOnly, IsFixedSize, and IsSynchronized. What is this?
Somehow, I am displaying the attributes of the array instead of the values actually contained inside of the array.
I know there are legit values in the array because when I step through the code I can clearly see the contents (names and ages). What am I doing wrong?