My DataTable Contains 17 columns, among which i am retrieving 3 columns. For Instance, we consider those 3 columns as colA, colB, colC. My requirement is, the resultant should be in a format of
Dictionary<string, Dictionary<string,string>> ( Dictionary<colA,Dictionary<colB,colC>> )
It would be better using LINQ…!
Dictionary<string, Dictionary<string, string>> roles = TA_Roles.GetRoleByUsername(Username)
.Select(col => new { col.RoleID, col.Rolecode, col.Rolename })
//Please continue from here..!
This should work if colA is unique: