Looks like your issue is with your
groupIDinput parameter.
var listOfGroups = db.Query("SELECt GroupID FROM Membership WHERe UserID = (SELECt UserID from Users WHERe Username = @0 )", username);
Your
listOfGroupsis coming back as a collection of the
WebMatrix.Data.DynamicRecordobjects. You seem to want just the
intvalue,
as you get
groupIDin the
foreach(var groupID in listOfGroups)statement.
Try instead replacing the last line:
AND e.event_end <= @5", groupID, start, end, groupID, start, end
with:
AND e.event_end <= @5", (int)groupID.GroupID, start, end, (int)groupID.GroupID, start, end
This should pull the value from the first (and only) column of each dynamic
query result, that value being the int group ID that you are after.
EDIT: Corrected value call syntax of DynamicRecord query result.
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)