I have a Comma Separated Value text file read and parsed into a C# List with four strings. One string has the string date format of:
"20090501 00:00:00.308"
Another string contains a float datatype of something like 10.00001.
I want to use the following C# code from How to bulk insert into MySQL using C#
var bl = new MySqlBulkLoader(connection);
bl.TableName = "mytable";
bl.FieldTerminator = ",";
bl.LineTerminator = "\r\n";
bl.FileName = "myfileformytable.csv";
bl.NumberOfLinesToSkip = 1;
var inserted = bl.Load();
Debug.Print(inserted + " rows inserted.");
The problems is I want to convert the CSV string data types to the proper MySQL datatypes of DECIMAL and DATETIME. Can I use the above source code example and still convert on the fly using it? If so, how can it be done. If not, do I still have to use SQL insert one at a time and convert on each individual insert?