title: MySql command "load data infile" execution error in C#
body: <p>I am trying to import a text file into MySql database using C# code but getting errors. 
  My table structure is:
  <img src="https://i.stack.imgur.com/8nzlH.png" alt="Mysql database table"></p>
  
  <p>and the C# code that I'm executing is:</p>
  
  <pre><code> fileQuery =
                  "load data infile '{0}' into table dgl.deliveries fields terminated by '\t' lines terminated by \r\n' (@ImagePath, Delivery_Note, Shipment_Number, @Delivery_Date, Deliver_To_Code, Deliver_To_Name, Sold_To_Code, Sold_To_Name, Material_Number, Doctype) set Delivery_Date = tr_to_date(@Delivery_Date, '%d/%m/%Y'), ImagePath = Concat('USERFILES/', @ImagePath)";
  
              string q = string.Format(fileQuery,fileName);
  
              MySqlConnection conn = new MySqlConnection(dglConnection.ConnectionString);
              MySqlCommand command = conn.CreateCommand();
              command.CommandText = q;
              conn.Open();
              command.ExecuteNonQuery();
  </code></pre>
  
  <p>and the error is:</p>
  
  <pre><code>An exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.DLL but was not handled in user code
  
  Additional information: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%d/%m/%Y'), ImagePath = Concat('USERFILES/', @ImagePath)' at line 2
  </code></pre>
  
  <p>The following is a line from source input file:</p>
  
  <pre><code>123.pdf 802661341   1061611 18/02/2015 00:00:00 22280   ABC LIMITED 22280   XYZ LIMITED 30679795 30744488   DELIVERY NOTE   1
  </code></pre>