Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1053243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:13:19+00:00 2026-05-16T17:13:19+00:00

Using Windows Server 2003, MySQL 5.1.23, MySQL .NET Connector 6.2.2 I am trying to

  • 0

Using Windows Server 2003, MySQL 5.1.23, MySQL .NET Connector 6.2.2

I am trying to use the MySQLBulkLoader class to read in a fixed width text file. An excerpt from that classes Load method is:

string sql = BuildSqlCommand();
MySqlCommand cmd = new MySqlCommand(sql, Connection);
cmd.CommandTimeout = 10 * 60;// Timeout;
cmd.ExecuteNonQuery();

The string created by ‘BuildSqlCommand’ is:

LOAD DATA LOCAL INFILE 'c:/M/D/ALLDATA_0.TXT' INTO TABLE dk.tk 
FIELDS  TERMINATED BY '' LINES TERMINATED BY '\n' 

When the program launchs the ‘ExecuteNonQuery’ the following error occurs:

(Message) Fatal error encountered during command execution.
(Source) MySql.Data
(Inner Exception Message) Fatal error encountered attempting to read the resultset.

Is there any known limitations to ExecuteNonQuery? The text file size is 290MB.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:13:19+00:00Added an answer on May 16, 2026 at 5:13 pm

    After many different attempts it looks like the error was related to a mix the syntax of the LOAD DATA INFILE statement and how the MySQL Bulk Loader works. I ended up completely ignoring the MySQL Bulk Loader class as the BuildSQLCommand method returned results that did not work. The problem with the BulkLoader is that it appears to want comma delimited files where my file was fixed width with no field delimiters.

    The following code sample works for importing a fixed width file – the table field sizes are setup to slice up the file into the appropriate fields.

    string sql = @"load data infile 'c:/myfolder/Data/" + aFile.Name 
    + "' ignore into table t_data fields terminated by '' enclosed by '' lines terminated by '\n'";
    MySqlCommand cmd = new MySqlCommand(sql, conn);
    cmd.CommandTimeout = Timeout;
    cmd.ExecuteNonQuery();
    

    My Timeout value is set to 0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I installed php and mysql on a Windows 2003 server running IIS6. I uncommented
Running php 5.2.5 on Windows Server 2003 (64 bit) and connecting to SQL Server
I'm trying to connect to a MySQL 5 database using the MySQL ODBC 5.1
I'm using Entity Framework to access my MySQL database. The model was generated using
I am trying to deliver an SSIS package to SQL Server 2005 Enterprise Edition
my application is developed on classic asp, but also uses asp.net as I am
How can I insert huge BLOBs into a MySQL database (InnoDB)? Fields of type
I have, as best as I can manage, set up IIS (6.0), PHP (5.2.8)
I have been looking around the current options (and related SO questions) regarding PHP
I would like to make a web-based game which is Travian-like (or Ikariam-like). The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.