Click here to Skip to main content
15,895,283 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,if I put AllowPaging="False" this works but I need paging on my project,when I put AllowPaging="True" it doesnt work !
and error is "The data source does not support server-side data paging"
Can any body help me ? I am new in coding
thanks

<asp:GridView ID="GridView6" runat="server" BackColor="White"
BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4"
ForeColor="Black" GridLines="Vertical" Width="507px" PageSize="3"
AllowPaging="True" onpageindexchanging="GridView6_PageIndexChanging">
<alternatingrowstyle backcolor="White">
<columns> <asp:TemplateField >
<itemtemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />


<footerstyle backcolor="#CCCC99">
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
<pagerstyle backcolor="#F7F7DE" forecolor="Black" horizontalalign="Right">
Font-Bold="True" />
<rowstyle backcolor="#F7F7DE">
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<sortedascendingcellstyle backcolor="#FBFBF2">
<sortedascendingheaderstyle backcolor="#848384">
<sorteddescendingcellstyle backcolor="#EAEAD3">
<sorteddescendingheaderstyle backcolor="#575357">



code behind:


SqlCommand cmd = new SqlCommand(" ", con);
SqlDataReader dr1;
con.Open();
cmd.CommandText = "my select quary"
dr1 = cmd.ExecuteReader();
if (dr1.HasRows == true)
{
con.Close();
GridView6.DataSource = dr1;
GridView6.DataBind();
}
con.Close();
Posted
Updated 18-Jul-14 10:16am
v2

1 solution

Use SqlDataAdapter instead of using SqlDataReader

Below post explains it well with code example.Hope it will help to you..

http://stackoverflow.com/questions/17606868/data-source-does-not-support-server-side-data-paging[^]

Happy coding
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900