CsvReader
CsvReader copied to clipboard
CsvReader.GetValue(s) method not works as expected, but GetXXX works perfectly
Hello! I have some project which uses your library for loading CSV data into SQLite storage (you can see code at https://github.com/shmutalov/System.Data.Csv)
Firstly I tried to load row values by single call to CsvReader's GetValues/GetValue method. I don't know why, but it doesn't work as expected.
Then, I looked into your source (not very deep) and find that GetXXX methods have same behaviour as GetString method, which gets value by accessing list item through "this[i] => string". But GetValue method calls FieldValue(int field) which will throw error, if Columns were not initialized.
Thanks for the info - I'll try and have a look at it this weekend
Hi @shmutalov,
Do you have test code or a gist that I can look at? Or a unit test that demonstrates the issue?
Thanks, Josh