我有这个 sql 命令:
SELECT Jmeno,
COUNT(CASE WHEN Ucast = 'TRUE' then 1 end) as Pocet_zapasu,
SUM(CASE WHEN Branky>=0 then Branky end) as branek
FROM Hraci
INNER JOIN Ucast_Zapas ON Ucast_Zapas.ID_Hrace_zapas=Hraci.IDHrace
INNER JOIN Zapas ON Zapas.ID_zapas=Ucast_Zapas.ID_zapasu_ucast
INNER JOIN Kategorie ON Kategorie.IDkategorie=Zapas.Kategorie_zapas
WHERE (Zapas.Druh=1) GROUP BY Jmeno
但是当我在 listview 中使用这个命令时:
<asp:ImageButton ID="Image2" runat="server" ImageUrl="~/Icons/edit.png" PostBackUrl='<%#string.Format("/Default3.aspx?id={0}",Eval("IDHrace"))%>' />
我有这个错误:
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'IDHrace'.
因为在 sqlcommand 中缺少 Hraci.IDHrace ...但我不知道为什么我将 Hraci.IDHrace 提供给以前的 sqlcommand .. 你知道吗?