Sunday, August 11, 2013

LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.


 Solution : Please check below code which is working in my case.After solving above error.  
 public IList<EMPData> GetEMPDataList(Guid empid)  
     {  
       IList<EMPData> objEMPData = null;  
       try  
       {  
         using (EMPDataDBEntities context = new EMPDataDBEntities3())  
         {  
           objData = context.EMPDatas.Where(entity => entity.ID == 0 && entity.EMPCode == (Guid)empid).ToList();  
         }  
       }  
       catch (Exception ex)  
       {  
         m_log.trace(ex);  
       }  
       return objEMPData ;  
     }  

0 comments:

Post a Comment