string sql = string.Format(
@"SELECT M.ManufacturerID
,M.DeviceCode
,M.DeviceName
,M.Repertoire,
(SELECT COUNT(*) FROM Catalogue AS [C] WHERE(([C].ManufacturerID = [M].ManufacturerID) AND ([C].DeviceCode = [M].DeviceCode) AND ([C].VendorID = [V].VendorID))) [LotsCount]
FROM Manufacturers AS [M]
LEFT JOIN Vendors AS [V] ON [V].ManufacturerID = M.ManufacturerID
WHERE (([V].VendorID LIKE ‘%V0%’) AND ([M].Enabled = 1))
ORDER BY [M].DeviceCode")
return ctx.Manufacturers.SqlQuery(sql).ToList();
返回值将绑定转发器控件,但此处[LotsCount]
未绑定到我的转发器
<itemtemplate>
在
<asp:HyperLink ID="LST_LotsCount" Text='<%# Eval("LotsCount") %>' runat="server"></asp:HyperLink>