How does we get records from 5 to 15 from a dataset of 100 records?

SqlConnection con=new SqlConnection (ConfigurationSettings.AppSettings["cons"]);
SqlCommand cmd=new SqlCommand("student",con);
SqlDataAdapter db=new SqlDataAdapter();
db.SelectCommand=cmd;
cmd.CommandType=CommandType.StoredProcedure;
DataSet ds = new DataSet();
db.Fill(ds,5,15,"student");
DataGrid1.DataSource=ds;
DataGrid1.DataBind();

this will return the 10 rows of the result set. In the above code “student” is the name of the stored procedure.

Tagged , , . Bookmark the permalink.

Leave a Reply