Compiler Error CS0163

  • Thread starter Thread starter Ramsey Schaffnit
  • Start date Start date
R

Ramsey Schaffnit

Documentation for error message Compiler Error CS0163 says:
Control cannot fall through from one case label ('label') to another

Ok, fine.



Documentation for switch statement says the same thing, but ALSO says:

Although fall through from one case label to another is not supported, it is
allowed to stack case labels, for example:
case 0:
case 1:
// do something;

In the event, my code gets the CS0163 error on the following:

switch {

case dbType.dbtOracle:

case dbType.dbtOracleMS:

blah, blah;

}



So what's right? (And, yes, dbType is an enum.)
 
It wasn't the code I showed that caused the error - it was what came, or
rather DIDN'T come, next. I had no break following the second case. I'll
try to claim it was the enum that confused me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top