Reputation: 17469
The CSV type provider in FSharp.Data creates Row types with properties for easily accessing cells in a row. The auto-generated properties are based on the column headers. For example, the Name property in this example:
type MyCsvFile = CsvProvider< "MyCsvFile.csv" >
MyCsvFile.GetSample().Rows
|> Seq.iter(fun r -> printfn "%s" r.Name)
Sometimes I find that the auto-generated properties (like Name in the above example) are not auto-generated. I get an error:
error FS0039: The field, constructor or member 'Name' is not defined.
Why?
Upvotes: 1
Views: 99
Reputation: 17469
Double-check that you have the same number of columns in all your rows. That was causing the problem on one of my projects.
Upvotes: 1