The problem is that
csv
isn't an array - if you hover the mouse over it, its an
IEnumerable<string[]>
- an enumerable collection of arrays of strings.
You can convert that to an array of array of strings by adding brackets:
var csv = (from line in contents
select line.Split(':')).ToArray();
But that won't help you either: you are splitting a collection of items to create it, and that produces an array of strings - you need to decide which of those strings you are trying to use as the
Name
column data for your DataTable.
I'd start by looking at your file and thinking about what it contains: it probably isn't what you expect, especially given that "csv" normally stands for "comma delimited vales" and you are splitting on ":".
Sorry, but we can't do any of that for you: we have no idea what your file contains!