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 8577913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:16:01+00:00 2026-06-11T20:16:01+00:00

I built a parser that takes data stored in an xml file and sends

  • 0

I built a parser that takes data stored in an xml file and sends it into a Microsoft Access database using linq-to-sql. I have the sql insert commands and they work… until they don’t.

It’s odd, I have each SQL command run (I keep them in a List and execute each command one at a time) and the first 40 or so run fine until they start hitting “unspecified error”s. The thing is, if I swallow the exception and instead have the exception catcher keep retrying, after a few seconds, they start working again. This means it’s not an error of the SQL query itself (or at least how it’s written).

This pattern repeats (there are thousands of inserts) many times. If I do normal exception handling, the program will just skip a few records while the error happens and keep inserting when whatever causes it temporarily goes away. if I let it run it’s course, it inserts some records, skips some, inserts, skips, repeat and eventually inserts less than 2/3 of the records.

Is there any reason why my computer would only run 40 or so Inserts and then refuse to run more for a random but short interval?

I’m at a loss on what could be causing this.

The application is natively run; it does not use any server/web communication and all I found when looking for “unspecified error” pointed me to occurrences in ADO.NET applications.

Here’s the code the error happens in:

public static string insertQuery(string sql)
    {
        string connetionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and Settings\Owner\Desktop\Arbeit\TrademarkParserproject1\TrademarkParserproject\bin\x86\Debug\Database.accdb";
        OleDbConnection connection;
        OleDbDataAdapter oledbAdapter = new OleDbDataAdapter();
        connection = new OleDbConnection(connetionString);

        string success = "false";

        try
        {
            connection.Open();
            oledbAdapter.InsertCommand = new OleDbCommand(sql, connection);
            oledbAdapter.InsertCommand.ExecuteNonQuery();

        }

        catch (Exception ex)
        {
            success = ex.ToString();
            return success;
        }

        success = "true";
        return success;
    }

Note, I have the application running in X86 mode to avoid errors with the ACE.OLEDB.12.0 adapter.

  • 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-06-11T20:16:03+00:00Added an answer on June 11, 2026 at 8:16 pm

    One thing that stands out, is you never close/dispose your SqlConnection. OleDbDataAdapter is also disposable and should be disposed. A ‘using’ statement is a convenient construct here:

    public static string insertQuery(string sql)
    {
        string connetionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and Settings\Owner\Desktop\Arbeit\TrademarkParserproject1\TrademarkParserproject\bin\x86\Debug\Database.accdb";
        using(var oledbAdapter = new OleDbDataAdapter())
        using(var connection = new OleDbConnection(connetionString))
        {
            string success = "false";
    
            try
            {
                connection.Open();
                oledbAdapter.InsertCommand = new OleDbCommand(sql, connection);
                oledbAdapter.InsertCommand.ExecuteNonQuery();
            }
    
            catch (Exception ex)
            {
                success = ex.ToString();
                return success;
            }
    
            success = "true";
            return success;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im using Python's built in XML parser to load a 1.5 gig XML file
Is there a built parser that I can use from C# that can parse
Currently, I'm sitting on an ugly business application written in Access that takes a
I'm trying to build a parser that would be able to extract the data
My project requires a file where I will store key/value pair data that should
I'm trying to serialize some data to xml in a way that can be
I have a problem with an app that takes an XML feed, parses it,
Currently I'm working on a program that parses through a file and takes characters
Is there a built in Java code that will parse a given folder and
(Using Python 3.2, though I doubt it matters.) I have class Data , class

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.