hi i got error in datalist

Posted by reddysankark-13471 under ASP.NET on 9/22/2012 | Points: 10 | Views : 1113 | Status : [Member] | Replies : 2
hi

plz clear the error its useful for me

error

DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'BrandName'.
<asp:Label ID="lblBrandName" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"BrandName")%>'></asp:Label>
aspx

<asp:DataList ID="dlBrand" RepeatColumns="1" runat="server" Width="100%" OnItemCommand="dlBrand_ItemCommand">
<HeaderStyle BackColor="Lavender"/>
<ItemStyle BackColor="Azure"/>
<AlternatingItemStyle BackColor="LightBlue"/>
<HeaderTemplate >
<table style="width:100%">
<tr>
<td style="width:25%" align="center">Brand Name</td>
<td style="width:45%" align="center">Description</td>
<td style="width:15%" align="center">Edit</td>
<td style="width:15%" align="center">Delete</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table style="width:100%">
<tr>
<td style="width:25%" align="center">
<asp:Label ID="lblBrandName" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"BrandName")%>'></asp:Label>
</td>
<td style="width:45%" align="center">
<img id="imgBrand" alt='<%#DataBinder.Eval(Container.DataItem,"Description")%>' src='<%#DataBinder.Eval(Container.DataItem,"Logo","~/Browse/Images/{0}")%>' runat="server" width="100" height="75" />
</td>
<td style="width:15%" align="center">
<asp:ImageButton ID="IbtnBrandEdit" AlternateText="Edit Record" ImageUrl="~/Admin/AdminCatalog/Images/edit.gif" CommandName="Edit" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ID")%>' runat="server" />
</td>
<td style="width:15%" align="center">
<asp:ImageButton ID="IbtnBrandDelete" AlternateText="Delete Record" ImageUrl="~/Admin/AdminCatalog/Images/delete.gif" CommandName="Delete" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ID")%>' runat="server" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
aspx.cs

stored procedure
ALTER procedure [dbo].[spGetAllBrand]
AS
select BrandName,Description from tblBrands where Active=1

sankarreddy


Responses

Posted by: Jayakumars on: 9/23/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
Reddysankark@Yahoo.Com
did u reach this error
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'BrandName'.

Solution

your select query did not return BrandName Field check your dataset or datatble view method.


Mark as Answer if its helpful to you

reddysankark-13471, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 9/23/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

Please mark as answer if it helpful to you.

Mark as Answer if its helpful to you

reddysankark-13471, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response