Here you find the most common problems that you can find using this lib. Vs.net say: "The type or namespace name 'FileHelperEngine' could not be found" You must add a reference to the FileHelpers.dll: Vs.net say: "The type or namespace name 'DelimitedRecord' could not be found (are you missing a using directive or an assembly reference?)" You must add an using or imports directive: C#: using FileHelpers VB.NET: Imports FileHelpers I got a BadUsageException when instanciate a FileHelperEngine class The exception message say you what attribute or condition is wrong. How can indicate that a file is quoted with "..." or other char ? You must use the FieldQuotedAttribute like this: [FieldQuoted] public string CustomerName I have a file with fixed format what attributes must use ? You must use the FixedLengthRecordAttribute for the class and the FieldFixedLengthAttribute for the fields: [FixedLengthRecord] public class OrdersFixed { [FieldFixedLength(7)] public int OrderID; [FieldFixedLength(12)] public string CustomerID; .... I have a file with a delimiter what attributes must use ? You must use the DelimitedRecordAttribute for the class and the FieldDelimiterAttribute for the fields: [DelimitedRecord("|")] public class OrdersFixed { public int OrderID; public string CustomerLastName; public int CustomerFisrt; ... How i can set the field date format ? You must use the ConverterAttribute with the format: [FieldConverter(ConverterKind.Date, "ddMMyyyy" )] public DateTime ShippedDate; [FieldConverter(ConverterKind.Date, "MMddyyyy" )] public DateTime ShippedDate; [FieldConverter(ConverterKind.Date, "d/M/yyyy" )] public DateTime ShippedDate; [FieldConverter(ConverterKind.Date, "d-M-yy" )] public DateTime ShippedDate; My files has a header line, how i can ignore it ? You can use the IgnoreFirstAttribute. [IgnoreFirst] // Discard one line public class OrdersVerticalBar { ... [IgnoreFirst(2)] // Discard two lines public class OrdersVerticalBar { ... When I use the ExcelStorage I get a type not defined error... You need to add a reference to the FileHelpers.ExcelStorage.dll because the ExcelStorage class is defined in this assembly. Remember you don't must to reference to the Interop files directly. I need that the library include a new feature or documentation ? Go to the Contact Page and send me a mail with your ideas, if the feature is easy or useful i add it to the FileHelpers. More questions ?? search it below or send your question to the list.
Here you find the most common problems that you can find using this lib.
You must add a reference to the FileHelpers.dll:
C#: using FileHelpers VB.NET: Imports FileHelpers
The exception message say you what attribute or condition is wrong.
[FieldQuoted] public string CustomerName
You must use the FixedLengthRecordAttribute for the class and the FieldFixedLengthAttribute for the fields:
[FixedLengthRecord] public class OrdersFixed { [FieldFixedLength(7)] public int OrderID; [FieldFixedLength(12)] public string CustomerID; ....
You must use the DelimitedRecordAttribute for the class and the FieldDelimiterAttribute for the fields:
[DelimitedRecord("|")] public class OrdersFixed { public int OrderID; public string CustomerLastName; public int CustomerFisrt; ...
[FieldConverter(ConverterKind.Date, "ddMMyyyy" )] public DateTime ShippedDate; [FieldConverter(ConverterKind.Date, "MMddyyyy" )] public DateTime ShippedDate; [FieldConverter(ConverterKind.Date, "d/M/yyyy" )] public DateTime ShippedDate; [FieldConverter(ConverterKind.Date, "d-M-yy" )] public DateTime ShippedDate;
[IgnoreFirst] // Discard one line public class OrdersVerticalBar { ... [IgnoreFirst(2)] // Discard two lines public class OrdersVerticalBar { ...
[IgnoreFirst] // Discard one line public class OrdersVerticalBar { ...
[IgnoreFirst(2)] // Discard two lines public class OrdersVerticalBar { ...
More questions ?? search it below or send your question to the list.
Must Read - Quick Start Guide - Attributes List - F.A.Q. - Examples of Use - Contacts & Credits - Donations