The problem statement is rather strange, because it mixes concepts from channels with continuos time and discrete time.
Suppose first that we have a discrete-time channel which is noisless but is contrained to send one of $M$ "symbols" (what you call "levels") at each channel use (each "discrete time"). The capacity of such a channel is, clearly,
$C_d = \log_2 M$ bits per channel use (always be careful with the capacity units).
If we can use that channel $N$ times in a time interval $T$, (that is, $N/T$ per second) then our capacity is $C= \frac NT C_d = \frac NT \log_2 M$ bits per second.
Now, the natural question would be: what is $N$, how many times per interval $T$ can I use my channel? Well, if the channel is bandlimited (frequencies $[-B,B]$), Nyquist tells me that I the critical sampling time is $1/2B$, so we have at most $2B$ "significant" values (or degrees of freedom) per second. Then you get $C = 2 B \log_2M$ bits per second.
The result is correct, but the explanation above is dubious. In particular, it's not clear at all how we would trasmit $N$ values with $M$ levels using a bandlimited signal during an interval $T$. Strictly speaking, that's not possible. We could think of a train of $N$ rectangular pulses, each having $M$ possible amplitudes; but this would not be bandlimited. We could instead think of a train of $N$ sinc pulses - this would be bandlimited, yes, but not time limited. Generalizing, we could think of $N$ orthogonal functions $\psi_i(t)$ ($i=1\cdots N$), of which the above are particular cases, and which are approximately (the approximation getting better as $T$ grows) bandlimited and time limited; we "modulate" these funtions by multiplying by our desired values to transmit $x(t)=\sum a_i \psi_i(t)$ (each $a_i$ takes $M$ "levels", in our case). What Nyquist says, in this generalized formulation, is essentially the same at he said for the simpler "sampling" scenario: we can find at most $2B T$ such functions. The format math behind this is quite complex (see eg).
For the application to channel capacity (and how one maps discrete-time to continous-time channels), see MacKay, chapter 11.