manjula d

manjula d

  • NA
  • 172
  • 139.8k

group_concat in LINQ

Oct 23 2013 9:30 AM
("SELECT GROUP_CONCAT(RoleName) as RoleName FROM tbl_user_relationU JOIN  tbl_role R ON R.role_id=U.RoleId WHERE U.user_id=9")

aboue query i want to change in LINQ

from U in objEntity.tbl_user_relation join R in objEntity.tbl_role on U.RoleId equals R.Role_Id where U.User_Id == 9 select new { RoleName = R.RoleName}).ToList().Select(x => new {RoleNames = string.Join(",", x.RoleName)});

i wrote  the aboue query but not displaying group of RoleNames

please help me...


Answers (2)