title: Error in Load Data infile query in C#
body: <p>I am having problem with the following code:-</p>
  
  <pre><code> private void btnUpload_Click(object sender, EventArgs e)
      {
  
          string nm = txtFilename.Text;
          string qry = "LOAD DATA INFILE 'D:\\HHTFiles\\" + nm + "' INTO TABLE `table1`.`location`FIELDS TERMINATED BY '--&gt;'LINES TERMINATED BY '\r\n'(Barcode,BinLoc);";
          cmd = new OdbcCommand(qry, con);
          int i = cmd.ExecuteNonQuery();
          if (i &gt; 0)
          {
              MessageBox.Show(" File loaded successfully...");
          }
  
  
      }
  
  private void btnBrowse_Click(object sender, EventArgs e)
      {
          OpenFileDialog openfiledailog1 = new OpenFileDialog();
          openfiledailog1.InitialDirectory = "D:\\HHTFiles\\";
          openfiledailog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
          openfiledailog1.FilterIndex = 2;
          openfiledailog1.RestoreDirectory = true;
  
          if (openfiledailog1.ShowDialog() == DialogResult.OK)
          {
              try
              {
                  if ((openfiledailog1.OpenFile()) != null)
                  {
  
                       txtFilename.Text = openfiledailog1.SafeFileName.ToString();
  
                  }
              }
              catch (Exception ex)
              {
                MessageBox.Show("Error: Could not read file from disk. Original error: "      + ex.Message);
              }
          }
      }
  </code></pre>
  
  <p>It runs properly, if I give the full file path in my query like :-
      string qry = "LOAD DATA INFILE 'D:\HHTFiles\ ABC.txt' INTO TABLE <code>table1</code>.<code>location</code>FIELDS TERMINATED BY '-->'LINES TERMINATED BY '\r\n'(Barcode,BinLoc);";
  But it throws error when the file path is passed in a String variable.</p>
  
  <p>Error:-
  ERROR [HY000] [MySQL][ODBC 5.1 Driver][mysqld-5.1.48-community]File 'D:HHTFilesABC.txt' not found (Errcode: 2)</p>