System.InvalidOperationException: DataTableReader is invalid for current DataTable
I deserialize a DataTable object from an XML file which works fine and the DataTable preview in Visual Studio displays the one row that it should contain.

However, when I create a DataReader on the table object like so:

        repository.SearchBaskets_dataReader = dataTable.CreateDataReader();

and attempt to read from it like so:

        while (repository.SearchBaskets_dataReader.Read())
                    { //BLAH BLAH }

I get a strange error, which I didn't always get:
    
        DataTableReader is invalid for current DataTable 'BasketOrders'.

Any ideas?

Let me re-emphasize that this bug started appearing without any changes in code.

        


    
System.InvalidOperationException: DataTableReader is invalid for current DataTable
===

I deserialize a DataTable object from an XML file which works fine and the DataTable preview in Visual Studio displays the one row that it should contain.

However, when I create a DataReader on the table object like so:

        repository.SearchBaskets_dataReader = dataTable.CreateDataReader();

and attempt to read from it like so:

        while (repository.SearchBaskets_dataReader.Read())
                    { //BLAH BLAH }

I get a strange error, which I didn't always get:
    
        DataTableReader is invalid for current DataTable 'BasketOrders'.

Any ideas?

Let me re-emphasize that this bug started appearing without any changes in code.

        


    