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 is sqldatareader?

572


Explain executenonquery?

660


What is Serialization in .NET? what are the types of Serialization?

634


How to identify the updated rows in a dataset?

610


Is it possible to load multiple tables in a Dataset?

617






What is the difference between typed and untyped dataset?

589


What is the advantage of ado.net?

641


How to creating a SqlCommand Object?

674


How to pass multiple tables in datasets simultaneously?

670


What are the different ado.net namespaces?

705


Define ado.net?

689


Give an example that shows how to execute a stored procedure in ado.net?

658


What is sql command in ado net?

584


What are all the different methods under sqlcommand?

597


Can we do database operations without using any of the ado.net objects?

619