I have a gridview in my form. I set the DataSource to a DataTable. I am retrieving a DataTable as follows:
SELECT AMOUNT, ISSUEDATE,REASON FROM PAYMENTS WHERE
PENSIONERID=113 ORDER BY ISSUEDATE DESC
When I run this request on the server side, I get three entries. But on my webpage, gridview shows only two of them. There is no condition in the code that causes gridview not to show any record. After a while, when I restart the server, I see the third row in the gridview. Is this a problem with my IIS? What could be the reason anyway? Thank.
Here is the loading code for the GridView and datat:
<asp:GridView ID="gvOdanBirm" runat="server" AllowPaging="True"
AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333"
GridLines="None" OnPageIndexChanging="gvPayments_PageIndexChanging"
PageSize="3">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:BoundField DataField="ISSUEDATE" HeaderText="Issue date">
<ItemStyle BorderColor="#01055E" BorderStyle="Solid" BorderWidth="1px"
HorizontalAlign="Right" Width="70px" />
<HeaderStyle BorderColor="#01055E" BorderStyle="Solid" BorderWidth="1px" />
</asp:BoundField>
<asp:BoundField DataField="AMOUNT" HeaderText="Amount">
<ItemStyle BorderColor="#01055E" BorderStyle="Solid" BorderWidth="1px"
HorizontalAlign="Right" Width="30px" />
<HeaderStyle BorderColor="#01055E" BorderStyle="Solid" BorderWidth="1px" />
</asp:BoundField>
<asp:BoundField DataField="REASON" HeaderText="REASON"
>
<ItemStyle BorderColor="#01055E" BorderStyle="Solid" BorderWidth="1px"
HorizontalAlign="Left" Width="50px" />
<HeaderStyle BorderColor="#01055E" BorderStyle="Solid" BorderWidth="1px" />
</asp:BoundField>
</Columns>
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
Code for:
gvPayments.DataSource= GetPayments(pensionerID);
gvPayments.DataBind();
source
share