Click here to Skip to main content
15,891,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
anyone please help me in this problem:
ASP.NET
<asp:GridView ID="aftersearchgridview" runat="server" AutoGenerateColumns="False"
    Height="293px" Width="578px" BackColor="White" BorderColor="White" BorderStyle="Ridge"
    BorderWidth="2px" CellPadding="4" GridLines="None" CellSpacing="2" OnRowDataBound="aftersearchgridview_RowDataBound"
    OnRowCommand="Detailbtnclick">
    <Columns>
         <asp:TemplateField HeaderText="S.No">
        <ItemTemplate>
            <asp:Label ID="Sr_No" runat="server"></asp:Label>
        </ItemTemplate>
    </asp:TemplateField>
        <asp:TemplateField HeaderText="Rejection Detail">
         <ItemTemplate>
            <asp:Label ID="rejdet" runat="server" Text='<% #Eval("code_description")%>'></asp:Label>
        </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Practice">
         <ItemTemplate>
            <asp:Label ID="practice" runat="server" Text='<% #Eval("practice_code")%>'></asp:Label>
        </ItemTemplate>
        </asp:TemplateField>


        <asp:ButtonField ButtonType="Button" runat="server" Text="Detail" HeaderText="Detail"
           CommandName="Detailbtn"/>
    </Columns>
    <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
    <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
    <PagerStyle ForeColor="Black" HorizontalAlign="Right" BackColor="#C6C3C6" />
    <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
    <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#F1F1F1" />
    <SortedAscendingHeaderStyle BackColor="#594B9C" />
    <SortedDescendingCellStyle BackColor="#CAC9C9" />
    <SortedDescendingHeaderStyle BackColor="#33276A" />
</asp:GridView>

the aboye code throws following exception:
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'practice_code'.
Posted
Updated 24-Jun-13 19:29pm
v3

DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'practice_code'

This error will arise when the coloumn name in your db and the column name you used in the source
( Eval(" ")) does not match..
 
Share this answer
 
Hi friend,


Check your sql query that you have the column with the name 'practice_code'.
 
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