title: Error uploading Excel file from ASP.NET application to MySQL
body: <p>I'm working on a web application (<strong>ASP.NET</strong>) with a <strong>MySQL</strong> database. When I try to upload an Excel file (<strong>.xlsx</strong>) via this application I have no issues. The issue begins when the file is more than 24904 records. </p>
  
  <p>At that point I get the following error:</p>
  
  <blockquote>
    <p>This table contains cells that are outside the range of cells defined in this spreadsheet.</p>
  </blockquote>
  
  <p>and it writes the first 24904 records.</p>
  
  <p>I tried to split the load in multiples batches and it did not work.</p>
  
  <p>Any thoughts?</p>
  
  <pre><code>Dim connExcel As New System.Data.OleDb.OleDbConnection(conStr)
  Dim cmdExcel As New System.Data.OleDb.OleDbCommand()
  Dim dt As New DataTable()
  Dim dataset As New DataSet
  Dim x As Integer = 2
  Dim y As Integer = 20001
  Dim range As String = "A" + x.ToString + ":" + "I" + y.ToString
  
  cmdExcel.Connection = connExcel
  
  If erro = 0 Then
      Try
  
          For i As Integer = 0 To 50
              connExcel.Open()
  
              dataset.Reset()
              dataset.Clear()
  
              Dim oda As New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM [Sheet1$" &amp; range.ToString &amp; "]", connExcel)
              oda.TableMappings.Add("Table", "ExcelTest")
  
              oda.Fill(dataset)
              connExcel.Close()
  
              If dataset.Tables(0).Rows.Count &gt; 0 Then
                  SendToDB(dataset)
              Else
                  i = 50
              End If
  
              x = x + 20000
              y = y + 20000
  
              range = "A" + x.ToString + ":" + "I" + y.ToString
          Next
  
          Label7.Visible = True
          Label7.Text = "The information has been written successfully from 0 to " + y.ToString
  
      Catch ex As Exception
          Label9.Visible = True
          Label9.Text = "Database Error 2:" + ex.Message
          connExcel.Close()
      End Try
  End If
  </code></pre>