CsvReader icon indicating copy to clipboard operation
CsvReader copied to clipboard

CsvReader.GetValue(s) method not works as expected, but GetXXX works perfectly

Open shmutalov opened this issue 9 years ago • 2 comments

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.

shmutalov avatar Dec 10 '15 07:12 shmutalov

Thanks for the info - I'll try and have a look at it this weekend

phatcher avatar Jan 04 '16 15:01 phatcher

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

joshgo avatar Feb 22 '16 17:02 joshgo