How to fill a OleDbDataAdapter with more than 12 records from Access DB

Pat Hanks 141 Reputation points

I have an app I am building that uses Access as the DB. While I am developing it, I have the DB located on a network share. I just ran into a limitation during the OleDbDataAdapter.Fill method where it is only returning 12 records. If I move the DB to the local drive, it will return the proper amount of rows. My connect string is really simple "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\filepath....\TFS_db.mdb"

Here is the section that is retrieving the records. (sqlText has the query string & RecipeTableName is the name of the table.)

using (var connection = new OleDbConnection(libRegistry.ConnectString))
using (OleDbDataAdapter dataadapter = new OleDbDataAdapter(sqlText, connection))
int rowsFilled = dataadapter.Fill(ds, RecipeTableName);

Is this a limitation in the OLEDB or Access? If so is there a way to work around it? I haven't been able to find anything from my searches related to a limitation.

Thanks for your help!

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,203 questions
{count} votes

Accepted answer
  1. Karen Payne MVP 35,031 Reputation points

    There is no limitation for a regular SELECT column names FROM SomeTable.

    Unless there is a really solid reason for using .mdb move to .accdb and try with similar code to the following. See if that works or not before using a DataAdatper. Also double check your connection string is pointing to the correct database.

    public static DataTable GetAll()
        DataTable table = new DataTable();
        using OleDbConnection cn = new() { ConnectionString = "TODO"};
        using OleDbCommand cmd = new() { Connection = cn };
        cmd.CommandText = "SELECT Id, FirstName, LastName FROM Person";
        return table;
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful