How to generically read text files and save into databases without evaluating data type?
<p>I need to write a C# program for reading any flat text files and, per every line, make a parsing using a "regexp" expression previously saved in a configuration file, which separates the line in several fields that are stored in a List object where each element is a field. Then, let to each field to be saved in the respective fields previously created within a database table and so on for each line.</p>

<p>At this point, everything is seen as that data is orchestrated without interference, as a pipe that runs from the text file to the database. However I face the difficulty where some of the fields can represent dates/hours in different formats, bool, double etc. For these few cases I will need to modify my program and make some sort of “IFs” that would minimally generate an overhead in processing times.</p>

<p>The question is to know whether there is any methodology or technique within the C# that, despite the special cases mentioned, it allows me to record the data in the database without the overhead of previous evaluations to establish the data type. </p>

<p>Thank you.</p>
