Question: I need to retrieve an id's name (`assessment name`)

```
 public int GetAssessmentNo(int AssessmentNo)
        {
            int AssNo = (from a in contxt.View_Assessment
                         where a.id == AssessmentNo
                         select a.AssessmentName);
            return AssNo;
        }

```

Cannot implicitly convert type **System.Linq.IQueryable**' to **int**

Answer: 
```
public string GetAssessmentNo(int AssessmentNo)
{
    string AssNo = (from a in contxt.View_Assessment
                 where a.id == AssessmentNo
                 select a).Single().AssessmentName;
    return AssNo;
}
If you write int Assno you cannot select AssessmentName because it is string datatype.you can change method datatype int to string after this you will get AssessmentName 
Hope it will help you

```
Your code actually returns a list (which probably in your case contains one item). Compiler can not convert a `IQueryable` into an `int`. You can do something like this to resolve the issue,

```
public int GetAssessmentNo(int AssessmentNo)
{
    return contxt.View_Assessment.First(a=> a.id == AssessmentNo).AssessmentName;
}

```