473,327 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Odd issue with Switch-Case statement in Code behind page.

Hello again. I'm assuming I'm doing something dumb here....

When I try and add a default: case to my switch statement, I get an
error that says "Error 1 Syntax error, '(' expected" and the red
squiggly is under the : after the word default. Can anyone see my silly
error? Thanks for the extra set of eyes!

-Guy

Here is the code for the entire method:

protected int[] GenerateClassfulSubnetMask(IPClasses ipClass)
{
switch (ipClass)
{
case IPClasses.ClassA:
int[] subnetMask = { 255, 0, 0, 0 };
return subnetMask;
case IPClasses.ClassB:
int[] subnetMask = { 255, 255, 0, 0 };
return subnetMask;
case IPClasses.ClassC:
int[] subnetMask = { 255, 255, 255, 0 };
return subnetMask;
case default:
break;
}
// If we reach here, something went wrong.....
int[] subnetMask = { 0, 0, 0, 0 };
return subnetMask;
}

Nov 2 '06 #1
2 1437
You just need to put "default:" rather than "case default:" :)

More info here:
http://msdn2.microsoft.com/en-US/library/06tc147t.aspx

--
Chris Fulstow
MCP, MCTS
http://chrisfulstow.blogspot.com/

Nov 2 '06 #2
*DOH* thanks chris. I knew it was something stoopid.
Chris Fulstow wrote:
You just need to put "default:" rather than "case default:" :)

More info here:
http://msdn2.microsoft.com/en-US/library/06tc147t.aspx

--
Chris Fulstow
MCP, MCTS
http://chrisfulstow.blogspot.com/
Nov 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mark Reed | last post by:
Compaq P4, 512mb Ram, XPPro, Office 2002 Pro. 1. Before MS SQL 2000 Client install MS Access 2002 properly created a new database in MYDOCUMENTS which is redirected to h:\users\%username% via...
1
by: Sandeep Arya | last post by:
Hello I am developing an application using PyQT. My application scenario is:: "At any instance one socket is open in my application. Now if user wants to execute some command on another...
1
by: Brandon | last post by:
Hello there. I'm currently working on a moderately complex Visual C# windows application that I have run into a bit of a problem on. To start things off, the application has normally been run...
0
by: Tom | last post by:
Here is a very strange problem that I am stumped by. I have a rather large application written in VB.NET (of course) using Framework 1.1. As you know, with an MDI application you can have multiple...
0
by: mkoirala | last post by:
I am doing a project in .NET. I have three forms say A,B,C. Form A is a mdicontainer. Form C is the modal dialog form and opens on pressing a button in form B.Now I run the application and open form...
7
by: Nightcrawler | last post by:
Hi all, I am trying to use regular expressions to parse out mp3 titles into three different groups (artist, title and remix). I currently have three ways to name a mp3 file: Artist - Title ...
7
by: prakashdehury | last post by:
Hi, I have a c# console exe Based on input it consumes arround 1-3 gb of memory I am trying to run it on win2003 box with 8GB of ram. Once the consumed memory goes beyound 1 GM the process...
2
by: Ubimmc93 | last post by:
I explain the situation briefly. I have a script taking a parameter: switch.php?param=value depending on this parameter I want to make a redirect to 1 of the 5 destination scripts,...
1
by: johndavid | last post by:
I work for as a Computer Systems Manager for a large government agency with a baffling problem. Some of what I will say below makes zero sense, which is why I am baffled. I have a site that...
0
by: mikomty | last post by:
I get the following error message when trying to write/read to a Data Acquisition Switch Unit 34970A using IEEE. Attempted to read or write protected memory issue. This is often an indication that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.