---
title: "The type of one of the expressions in the join clause is incorrect. Type inference failed"  
description: "The type of one of the expressions in the join clause is incorrect. Type inference failed"  
author: "Anonymous User"  
published: 2014-09-20  
updated: 2014-09-20  
canonical: https://www.mindstick.com/forum/2262/the-type-of-one-of-the-expressions-in-the-join-clause-is-incorrect-type-inference-failed  
category: "c#"  
tags: ["c#", ".net", "linq"]  
reading_time: 1 minute  

---

# The type of one of the expressions in the join clause is incorrect. Type inference failed

I’m [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to join [two tables](https://www.mindstick.com/forum/159646/how-to-join-two-tables-in-oracle-to-get-single-line-results) using [linq to sql](https://www.mindstick.com/articles/338528/how-to-use-linq-to-sql-select-query-using-c-sharp). I am [getting error](https://www.mindstick.com/forum/159638/getting-error-microsoft-office-interop-outlook-doesn-t-work) on join [keyword](https://www.mindstick.com/forum/33572/sql-inner-join-keyword) that "Error 14 The type of one of the [expressions](https://www.mindstick.com/forum/33876/what-is-the-syntax-for-lambda-expressions-in-vb-dot-net) in the join [clause](https://www.mindstick.com/forum/33937/difference-between-throw-exception-and-throw-clause) is incorrect. Type inference [failed](https://www.mindstick.com/forum/160484/error-failed-to-launch-debug-adapter-additional-information-may-be-available-in-the-output-window) in the call to 'Join'."

```
var query = (from es in Company.Employee_Salary                         join ed in Company.Employee_Details on es.Employee_ID equals es.Student_ID                         orderby es.Employee_ID                         select new {  es.Month }).ToList();
```

## Replies

### Reply by Anchal Kesharwani

hi ashish,\
I hope that this code help you.\

What if you cast the id that is an **int** to a **string** before comparing?

```
var query = (from es in Company.Employee_Salary                         join ed in Company.Employee_Details on es.Employee_ID.ToString() equals es.Student_ID                         orderby es.Employee_ID                         select new {  es.Month }).ToList();
```


---

Original Source: https://www.mindstick.com/forum/2262/the-type-of-one-of-the-expressions-in-the-join-clause-is-incorrect-type-inference-failed

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
