If a dataset contains 100 rows, how to fetch rows between 10
and 20 only ?

Answer Posted / muthu kumar

DataSet ds = new DataSet();
ds.Load(cmd.ExecuteReader(),
LoadOption.OverwriteChanges, "sample");

DataRow[] dr = ds.Tables[0].Select("id>1 and id<10");

for (int i = 0; i < dr.Length; i++)
{
Response.Write(dr[i][0].ToString()+"<br>");


}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the parameters that control most of connection pooling behaviours?

574


How to load multiple tables into a dataset?

540


How to bind the controls(best practice) comboboxes to the data in the dataset?

540


What is ambient transaction?

506


What property must be set and what method must be called in your code to bind the data from some data source to the Repeater control?

554






Explain how do you connect to sql server database without using sqlclient?

478


Describe the disconnected architecture of ADO.NET’s data access model.

538


how you will deal result set? How do you sort a dataset?If a dataset contains 100 rows, how to fetch rows between 5 and 15 only?

581


What is a string variable?

484


What are the ado.net objects?

510


How to check if a datareader is closed or opened? IsClosed()

580


Is it possible to edit data in Repeater control?

529


What is difference in record set and dataset?

534


Describe connection object in ado.net

539


What is the difference between typed and untyped dataset?

508