Slow execution of queries on a Microsoft Access database via ADO .Net
I am reimplementing a C++ layer into a C# layer at my company. SQL queries are executed in the layer on a Microsoft Access database via an ODBC datasource. The database is a .mdb file and the ODBC datasource uses the following driver : Microsoft Access Driver (*.mdb).
The C++ layer uses the Windows ODBC API to execute SQL queries via the ODBC datasource. For instance the SQLExecDirect function is called to execute a SQL query.
The C# layer uses the ADO .Net OdbcConnection class to execute SQL queries via the ODBC datasource.
The execution of several SQL queries takes less than 1 minute when using the C++ layer. The execution of the same SQL queries takes approximatively 20 minutes when using the C# layer. Does anyone know why the execution is slower when using the C# layer ?
Any help will be greatly appreciated
I have found why the execution of queries was slow when using the C# layer. I forgot to dispose the IDbCommand objects.