GridView's Paging..... Facing an ERROR -"The data source does not support server-side data paging."

Posted by Nishadullas under ASP.NET on 8/13/2011 | Points: 10 | Views : 4970 | Status : [Member] | Replies : 1
Hi .....
I am creating a website as a project and i am using ASP.NET and SQl Server 2005.
On my page i have a Textbox , a button with search command on it's click event and a gridview on which the datas will get displayed after i search a particular record from database.
Now i want that the gridview should show only 10 records on its first page and for that i also set the AllowPaging property of Gridview to True.
But when i click the page ....i get an error --"The data source does not support server-side data paging." But when i set that property to False..then all the retrieved records get populated in gridview and if the records consist of 25Rows then the gridview shows 25Rows all in same page of gridview...

Please anyone help me to sort out this problem..

Here is the code that i have done to populate the GridView

 SqlConnection conP = new SqlConnection();
conP.ConnectionString = AppConfiguration.ConnectionString;
SqlCommand cmdp = new SqlCommand("select * from Details where Name like '" + TextBox1.Text + "%'", conP);
SqlDataReader drP = cmdp.ExecuteReader();
//grdParameterView.DataSource = drP;

GridView1.DataSource = drP;

I expect that my query will be solved with you all's help

Thank you.



Posted by: Nisar87 on: 8/13/2011 [Member] Starter | Points: 25

Did you hanlde paging event? you need to implement paging on your page if you want to display 10 records per page.
please refer below link for paging and sorting in gridview

Nisar Ahmad

Nishadullas, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response