Е, най-накрая разбрах отговора. операторът LOAD DATA FILE изисква името на файла да бъде низова стойност, то не може да бъде параметризирано. За съжаление класът MySQLCommand не харесва екранирания \ в пътя на файла на C# низ обект, така че не може да намери файла. Накарах го да работи, като избягах от бягствата по следния начин:
//build the LOAD DATA File command
string working = String.Format("LOAD DATA LOCAL INFILE '{0}' IGNORE ", files.FirstOrDefault().ToString()) +
String.Format("INTO TABLE {0} COLUMNS TERMINATED BY ',' LINES TERMINATED BY '\n'", "by_switch")+
String.Format(" IGNORE 1 LINES (`Switch`,`Port`,`WWPN`,@the_slot,`Port Index`,@the_time,`Interval`,`Port Send Packet Rate`,")+
String.Format("`Port Receive Packet Rate`,`Total Port Packet Rate`,`Port Send Data Rate`,")+
String.Format("`Port Receive Data Rate`,`Total Port Data Rate`,`Port Peak Send Data Rate`,`Port Peak Receive Data Rate`,")+
String.Format("`Port Send Packet Size`,`Port Receive Packet Size`,`Overall Port Packet Size`,`Error Frame Rate`,")+
String.Format("`Dumped Frame Rate`,`Link Failure Rate`,`Loss of Sync Rate`,`Loss of Signal Rate`,`CRC Error Rate`,")+
String.Format(" `Short Frame Rate`,`Long Frame Rate`,`Encoding Disparity Error Rate`,")+
String.Format("`Discarded Class3 Frame Rate`,`F-BSY Frame Rate`,`F-RJT Frame Rate`, `Port Send Bandwidth Percentage`,")+
String.Format("`Port Receive Bandwidth Percentage`, `Overall Port Bandwidth Percentage`,`Primitive Sequence Protocol Error Rate`,")+
String.Format("`Invalid Transmission Word Rate`,`Link Reset Transmitted Rate`,`Link Reset Received Rate`)")+
String.Format("SET Slot = nullif(@the_slot,''),")+
String.Format(@"Time= str_to_date(@the_time,'%m/%d/%y %h:%i %p')");
// now escape the escape character
commandreplaced = commandreplaced.Replace(@"\", @"\\");
// now execute the command
MySqlCommand cmd = new MySqlCommand(commandreplaced,sqlconnect);