473,395 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Querying MS Access database using .NET's OLEDB is very slow

Hi,

I'm having a bit of a problem with a small application I wrote in C#,
which uses an Access database (mdb file) for storing financial data.

After looking for a similiar topic and failing to find one, I'm posting
the question in hope some one of you guys out there will have the
answer for me...!

I'll start with what I have, then I'll continue to the problem itself.

What I have:
I have an Access database file, with 3 tables: a primary one, which
holds the data, and 2 "lookup" tables for sub-categories in the main
table. They are linked programmatically and not via some relashionship
definition in the Access file itself.
This file is used by a C# application I wrote as a front-end which
connects to the mdb file and displays data from it in a DataGrid
components (among other things). The link to the database is done via
the OleDbConnection, OleDbAdapter, etc. objects.

The problem:
Querying the main table (called 'MoneyData') is extremely slow (a
simple 'SELECT * FROM MoneyData' takes 12.3 seconds with 205 records)
the first time, and slow the rest of the times (approx. 5 sec doing
some other kind of SELECT on the table).
I am requerying the database to get results according to dates (i.e
'SELECT * FROM MoneyData WHERE Month(aDate)=3 AND ...' ).

Tests I've done:
I tried running the code on another machine, where I got some better
results, but still unsatisfaying. The first query took 4.5 seconds and
the rest took approx 1.1 sec (which is acceptable, but still slow for
the amount of data in the table).
I tried adding an Index on the Date field and compacting the database
file, but it remained the same.
I also ran the simple SELECT query and some more complex ones inside
the Access interface, to see if the problem is with the mdb file or the
query itself, but there it worked very fast. no delay at all between
the query and the results.

Finally:
Since performing UPDATE/INSERT/DELETE commands seems to be working
fine, I assume there's something wrong only with the SELECT command.
The method responsible for it is the OleDbAdapter.Fill() method, as far
as I understand. Could it be that the problem is there? Is there a good
way to test it? and if so, and the problem is there, how can I replace
it?

Technical info:
I'm running XP Pro, SP2, with .NET 1.1 SP1
MS Access version: 2002 Pro

Your help is highly appreciated!!!

Roi

Nov 17 '05 #1
0 2567

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
63
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy...
7
by: Dan V. | last post by:
We use dot net, asp.net and iis 5 on a pentium 1.2 GHZ (dual capable - one in now) and 1 MB RAM and Access 2002. Our ASP.NET Database queries to MS Access (running locally) are very slow, (the...
6
by: Greg | last post by:
I am working on a project that will have about 500,000 records in an XML document. This document will need to be queried with XPath, and records will need to be updated. I was thinking about...
3
by: Mike Wilson | last post by:
Is there a way to open an OLE DB database from within Access? I would like to use the Access GUI with its table and query explorer to examine a database only available through an OLEDB provider...
1
by: Abareblue | last post by:
I have no clue on how to insert a record into access. here is the whole thing using System; using System.Drawing; using System.Collections; using System.ComponentModel;
12
by: VMI | last post by:
For some reason, the process of retrieving data (about 20 records) from an Access table that has 400K records to a dataTable is taking over 3 mins. to complete. Below is my code to connect to the...
11
by: CM Manager via DotNetMonster.com | last post by:
I am very frustrated due to this exception error I am receiving. I've tried searching numerous user support groups, Microsoft Support Net, Google, etc. and haven't found exactly my situation....
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.