protected void gvUsers_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Label lblGroup = (Label)e.Row.FindControl("lblGroupID"); GroupBC groupBC = new GroupBC(); UserBC userBC = new UserBC(); List<Entities.UserInfo> users = userBC.ReturnUsers(); List<Entities.GroupInfo> groups = groupBC.ReturnGroups(); var groupQuery = from user in users join g in groups on user.GroupID equals g.GroupID select new { GroupID = g.Description }; lblGroup.Text = groupQuery.ToString(); }
var groupQuery = (from user in users join g in groups on user.GroupID equals g.GroupID select g.Description).FirstOrDefault(); if(null != groupQuery) { lblGroup.Text = groupQuery.ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)