Hi all.
I need to select employeeID from tb_StaffMembers and put them in an Array.
here is my query:
var employIds = db.tb_staffMembers.Where(x => x.RoleId == 4).ToList().Select(x=>x.EmployeeId);
The query returns three IDs (2032, 2077, 2107) of which is correct.
now i want them in an array like : int [] array = new int[]{}
Please help.

shruthi palanRank #7,940 · 231 reputationPosted Mar 3, 2017, 12:32 AM EST
Rafnas T PRank #280 · 8.8K reputationPosted Mar 3, 2017, 12:31 AM EST
try this string[] strArray = "2032, 2077, 2107".Split(','); string[] strArray = employIds.Split(',');Sbonga Mathobela71 reputationPosted Mar 3, 2017, 12:43 AM EST
shruthi palan