我有这个代码:
var First_res = from r in reserve
join c in clerk on r.ClerkID equals c.ClerkID
select new { c.Name, c.Family, r.FoodID, r.Meal, r.Day };
var Second_res = from fr in First_res
join f in food on fr.FoodID equals f.FoodID
select new { fr.Name, fr.Family, fr.Meal, fr.Day, food = f.Name };
现在我想将 Second_res 绑定到 SqlDataSource,但是当我写下面的代码时,我有错误:
SqlDataSource1.DataSourceMode = Second_res;
我该怎么做?这是我的错误:无法将类型“System.Linq.Iqueryable”隐式转换为“System.Web.UI.WebControls.SqlDataSourceMode”