When you perform a LINQ query like that you don't get back a single value. Your deptid variable is NOT type Integer. A LINQ query returns, as the error message suggests, an IQueryable object. You need to enumerate that object to get the individual values it contains, which you do with a For Each loop. Even if it only contains a single value it doesn't matter. You still need to use a loop to get at that one value.
vb.net Code:
Dim deptIDs = From d ...
Dim deptID As Integer
For Each deptID In deptIDs
Next
After that loop deptID will contain the last value returned by the query. If the query only returned one value then the last value is the only value.
In a special case like this, where want the one and only value, you could also do this:
vb.net Code:
Dim deptID As Integer = deptIDs.ElementAt(0)
or this:
vb.net Code:
Dim deptID As Integer = deptIDs.First()
or this:
vb.net Code:
Dim deptID As Integer = deptIDs.FirstOrDefault()