title: Fatal error encountered attempting to read the resultset. MySQL Asp.Net
body: <p>I'm receiving that error when I tried to insert data from a txt file into a mysql table. I tried with the whole list, with just 1 item, with csv, even removing the "" and creating a new table with just one field, but the problem continue happening after 30 seconds. In my txt have a list of numbers that I need to insert in 1 field of the table, eventhough the table has three different fields. Thank you in advance. </p>
  
  <pre><code>protected void Button1_Click(object sender, EventArgs e)
  {
      if (FileUploadControl.HasFile)
      {
          try
          {
              if (FileUploadControl.PostedFile.ContentType == "text/plain")
              {
  
                  string filename = Path.GetFileName(FileUploadControl.FileName);
                  FileUploadControl.SaveAs(Server.MapPath("~/") + filename);
                  StatusLabel.Text = "Upload status: File, "+filename+" uploaded!";
                  string dir = Server.MapPath("~/") + filename;
                  string strcon = "SERVER = 000.000.000.00; " + "DATABASE=fakedb;" + "UID=fakeid;" +"PASSWORD=fakepass;";
                  Response.Write(dir);
                  MySqlConnection con = new MySqlConnection(strcon);
                 con.Open();
                  MySqlCommand cmd = new MySqlCommand("LOAD DATA LOCAL INFILE '" + filename + "' INTO TABLE Cuenta_Test  LINES TERMINATED BY '\n\r'", con);
                  cmd.ExecuteNonQuery();
                  con.Close();
              }
              else
                  StatusLabel.Text = "Upload status: Only txt files are accepted!";
          }
          catch (Exception ex)
          {
              StatusLabel.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
          }
      }
  }
  </code></pre>