Click here to Skip to main content
15,884,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have this code:

C#
namespace TA_SCOREBOARD_DATA
       {
           public class TA_Scoreboard_Classcs
           {

            SQL_TA_SCOREBOARDEntities1 contxt = new SQL_TA_SCOREBOARDEntities1();

               public List<String> EmployeeAccess2()
               {

                   EmployeeAccess EA = new EmployeeAccess();
                   View_HCM VH = new View_HCM();

                   var x = from a in EA
                           join b in VH on a.EmpNo equals b.EmpNo
                           select new
                           {
                              a.EmpNo,
                              b.EmailAddress
                           };

                    return x.ToList();
               }
           }
       }


*I'm getting these errors under:*

-- EA (from a in EA):

'Could not find an implementation for the query pattern...'

-- x.**ToList**();

'The type arguments for method 'System.Linq...IEnumerable<tsource>' cannot be inferred from the usage. Try specifying the type arguments explicitly.'

*WHERE:*

-- EmployeeAccess is a table (with *id* and *EmpNo* columns, *EmpNo* with 3 data)

-- View_HCM is a view (with *EmailAddress*, *EmpNo* columns and 1000+ data)

-- No IntelliSense under b.EmpNo

-- using *edmx, dbml* objects

-- already using System.Data namespaces

How do I "inner join" the 3 EmpNo in EmployeeAccess according to View_HCM EmpNo with EmailAddress?
Posted

1 solution

C#
EmployeeAccess EA = new EmployeeAccess();
  View_HCM VH = new View_HCM();


EA and VH are Types (class). you cannot use linq for a non IEnumerable Types.

instead try like this..
C#
List<employeeaccess> EA = new List<employeeaccess>(); </employeeaccess></employeeaccess>
 
Share this answer
 

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



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