Multi-thread access to a single datareader in C#.net 2.0
Posted on 2006-11-29
I am trying to figure out a way to access a single datareader object from multiple threads. I create the datareader and pass it into multiple instances of a thread that read from the datareader. The goal is to have two or more threads reading from the datareader so that thread 1 reads half the records and thread 2 reads the other half. I can get the threads to not throw errors by messing with the isolation type of the transaction for the connection but only one threads seems to read anything from the datareader and even then it reads only a fraction of the records. Any ideas on how to accomplish this?