Click here to Skip to main content
15,901,853 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
I have some data in my database like Skillname for example C#,C++ and so an, and the user can also save his skillevel that are stars that he saves from 1 star to four stars, not I am trying to, when I search for the skillname it display the Users names but I have also created a radiobuttonlist that display from 1 star to 4 stars so when the user select from the radiobuttonlist list and then select I want it to display the names that has that skill and that level.

In my search button I have like this
C#
if (RadioDisplayLevel.SelectedIndex == 0 || RadioDisplayLevel.SelectedIndex == 1 || RadioDisplayLevel.SelectedIndex == 2 || RadioDisplayLevel.SelectedIndex == 3)
 {
      FilterStarsLevel();
 }

And my function looks like this,
C#
private void FilterStarsLevel()
       {
         {
            using (var db = new knowitCVdbEntities())
             {
                var searchTechSkill = from p in db.EMPLOYEES
                join ets in db.EMPLOYEES_TECHNICAL_SKILLS on p.employee_id equals
                ets.employee_id join ts in db.TECHNICAL_SKILLS_VALUES on                     technical_skill_value_id equals ts.technical_skill_value_id join tsl in db.TECHNICAL_SKILL_LEVEL on ets.technical_skill_level_id equals          tsl.technical_skill_level_id where tsl.skill_level.Contains(RadioDisplayLevel.SelectedItem.Text)

                 select new Techskillsearch()
                   {
                       EmployeeId = p.employee_id,
                       Firstname = p.firstname,
                       LastName = p.lastname,
                       TechnicalSkillValueId = ts.technical_skill_value_id,
                       SkillName = ts.skill_name,
                       SkillNameOther = ets.skill_name_other,
                       SkillType = ts.skill_type,
                       TechnicalSkillLevelId = tsl.technical_skill_level_id,
                       SkillLevel = tsl.skill_level
                   };

                       foreach (var vEmp in searchTechSkill)
                       {
                           if (vEmp != null)
                           {
                               if (
                                   !_searchEmpList.Contains(vEmp.Firstname + " " + vEmp.LastName + "," +
                                                            vEmp.EmployeeId))
                               {
                                   _searchEmpList.Add(vEmp.Firstname + " " + vEmp.LastName + "," + vEmp.EmployeeId.ToString());
                               }
                          }
                       }
                   }
               }
       }

But I don't get it to work because it doesn't filter as I want to.
Any Sugestions ?
Posted
Updated 28-May-13 6:33am
v2
Comments
snorkie 28-May-13 13:25pm    
Start by taking out the

where tsl.skill_level.Contains(RadioDisplayLevel.SelectedItem.Text)

and see if it returns any results. If not, then you know that your joins are not correct.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900