Leer datarow desde el medio de las filas 101-200 del conjunto de datos

As i am having large dataset , to read that i am using threads. I want to read first 1-100 rows by creating new thread. and at the same time I want to read 101-200 by creating other thread.

I want to start both the threads at the same time.

Now the problem is how to read the dataset directly from 101-200 rows.It should directly point to 101 record.

Is there any way to do that...kindly help.

Gracias Ramesh.T.

preguntado el 27 de agosto de 11 a las 18:08

2 Respuestas

You can use Enumerable.Skip with a DataTable.

You want records 101 - 200, so skip 100 records and get next 100 records.

IEnumerable<DataRow> rows = table.AsEnumerable().Skip(100).Take(100);

contestado el 13 de mayo de 15 a las 13:05

Answer will probably depend on the database used, but most have a LIMIT clause that can be used to start at result X and return Y results. So for example in mysql: select * from table LIMIT 101,100;

Respondido 27 ago 11, 22:08

cant we read from certain point (101) in the dataset after all the records are returned from whatever the database is.Otherwise wha would be the best solution to read the large number of records from dataset instaed of looping all the rows row by row to make the performance fast. - Ramesh

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.