I am trying to create a simple console App that reads from a CSV file and creates or updates the fields from the CSV to the traget fields in my D365. I am using the class TextFieldParser, but getting stuck in the Loop.
string[] fields = parser.ReadFields();
foreach (var column in fields)
{
Console.WriteLine($"{column}");
}
After looping through, it shows me all the field headers in my CSV, but when i try to get the index of each field using column[0], rather than return the field, it only returns the first character of the field. I have read through the documentation of the TextfieldParser class, and the parser.ReadField return the fields in arrays. So why is it only retrieving the characters of the fields, when i am trying to get specific field position? Someone with experience please help out.
Cheers
*This post is locked for comments
I have the same question (0)