<asp:LinqDataSource
ContextTypeName="ExampleDataContext"
TableName="Products"
Select="new(Key as ProductCategory,
Average(Price) as AvePrice)"
ID="LinqDataSource1"
runat="server">
</asp:LinqDataSource>
不知何故,我在 .aspx 文件中的选择(如上所示)不起作用:查询结果中返回了所有列。所以我会尝试在后面的代码中做到这一点。
如何在我的 LinqDataSource1_Selecting () 中选择 2 个字段?谢谢。