1
我有内GridView的一个标签,我想查询像这样的东西绑定吧..自定义绑定代码表达式中的SQL查询?
select COUNT(*)
from tbl_like
inner join Scrap on tbl_like.scrapid=Scrap.Id
where tbl_like.likestatus=1 and tbl_like.scrapid='DataBinder.Eval(Container.DataItem,"ScrapId")'
我知道上面的代码将无法正常工作,我能做些什么,使工作?
源代码:
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# "Id of Scrap:"+DataBinder.Eval(Container.DataItem,"ScrapId") %>'></asp:Label>
</ItemTemplate>
它工作得很好。谢谢! – Arbaaz 2013-02-13 13:43:03