V
VMI
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 DB and query the table. The
table "audit" primary key is "Line".
Another weird thing (but I guess that's another post) is that, while it's
doing the dataset Fill, my PC is slowed done substantially. But I don't
know why that would happen since the process is not consuming much memory or
CPU. This must be an Access flaw because it also happens if I'm running
intensive queries from within Access.
/**** Code ****/
string strDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sFileName;
//sFileName is mdb file
_connection = new OleDbConnection(strDSN);
_oleCommand = new OleDbCommand();
_oleCommand.Connection = _connection;
_oleCommand.Connection.Open();
string sQuery = "select top 20 * from audit where Line > 0 order by Line
asc";
OleDbDataAdapter adapter = new OleDbDataAdapter(sQuery, _connection);
DataSet DS_Audit = new DataSet();
adapter.Fill(DS_Audit, "audit"); //this is taking 3 minutes
return DS_Audit.Tables["audit"];
The reason we're using Access is because every client must have their own
personal DB to store the data. If we use server DBs such as MSDE or MySQL,
we will need to install the DB in every PC (we can't install it in 1 PC
because we can't assume that the clients are in a network). With Access we
can create the mdb from our application. Someone suggested the embedded
version of MySQL but every client may have several different files (MDBs),
so I'm not sure if that would complicate things.
Thanks for any help.
Access table that has 400K records to a dataTable is taking over 3 mins. to
complete. Below is my code to connect to the DB and query the table. The
table "audit" primary key is "Line".
Another weird thing (but I guess that's another post) is that, while it's
doing the dataset Fill, my PC is slowed done substantially. But I don't
know why that would happen since the process is not consuming much memory or
CPU. This must be an Access flaw because it also happens if I'm running
intensive queries from within Access.
/**** Code ****/
string strDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sFileName;
//sFileName is mdb file
_connection = new OleDbConnection(strDSN);
_oleCommand = new OleDbCommand();
_oleCommand.Connection = _connection;
_oleCommand.Connection.Open();
string sQuery = "select top 20 * from audit where Line > 0 order by Line
asc";
OleDbDataAdapter adapter = new OleDbDataAdapter(sQuery, _connection);
DataSet DS_Audit = new DataSet();
adapter.Fill(DS_Audit, "audit"); //this is taking 3 minutes
return DS_Audit.Tables["audit"];
The reason we're using Access is because every client must have their own
personal DB to store the data. If we use server DBs such as MSDE or MySQL,
we will need to install the DB in every PC (we can't install it in 1 PC
because we can't assume that the clients are in a network). With Access we
can create the mdb from our application. Someone suggested the embedded
version of MySQL but every client may have several different files (MDBs),
so I'm not sure if that would complicate things.
Thanks for any help.