Updated Microsoft Access Database Engine 2010 to 2016 OleDbDataAdapter is not working

1.3k Views Asked by At

This code is used to convert CSV file to dataTable.

Before Updating to Microsoft Access Database Engine 2016, Our code works perfectly

connection = new OleDbConnection(Config.connectionString); connection.Open(); dataAdapter = new OleDbDataAdapter("select * from [" + fileName + "] ", connection);

After we updated to Microsoft Access Database Engine 2016, Our logic can't proceed after connection.open().

I tried with top 10 it's work perfectly. select top 10 * from [" + fileName + "]

after this I tried with 1000, it also works perfectly.

But when I tried to top 10000 line, it failed.

Note: CSV file contain more than 80000 rows.

2

There are 2 best solutions below

2
On

You use the term 'engine'; do you have a full installation of Office/Access 2016?

0
On

Since you have the full Access license; do an import of the csv file manually using the features available in the ribbon.

At the end of this process, the wizard is going to open a prompt as to whether you wish to save those steps. Save it with a meaningful name - and then you will be able to invoke that saved import easily.

This is not a fix of your old code - but rather a remake using the current technology.

To invoke the saved import is a simple docmd.runSavedImportExport