My Database
Advertise.aspx
<asp:TemplateField HeaderText="Hình ?nh">
<ItemTemplate>
<asp:Image ID="imgHinhanh" ImageUrl='<%#Eval("adv_Url") %>' runat="server"></asp:Image>
</ItemTemplate>
</asp:TemplateField>
Advertise.apsx.cs
public void BindGrid() {
grdAdver.DataSource = AdvertiseService.adv.Adver_GetAll();
grdAdver.DataBind();
}
AdvertiseService.cs
public List<AdvertiseInfo> Adver_GetAll()
{
return adv.Adver_GetAll();
}
AdvertiseInfo.cs
public partial class AdvertiseInfo
{
public int adv_id { get; set; }
public string adv_Name { get; set; }
public string adv_Url { get; set; }
public int? adv_Width { get; set; }
public int? adv_Height { get; set; }
public string adv_Link { get; set; }
public int? adv_Target { get; set; }
public int? adv_Position { get; set; }
public int? adv_Order { get; set; }
public int? adv_Status { get; set; }
}
Please help me. I wasted long time to fix but i can't. Thanks anyone.