Click here to Skip to main content
15,881,882 members
Home / Discussions / C#
   

C#

 
AnswerRe: C#_Error "Namespace cannot directly contain..." Pin
rajeevcapgeminiindia10-Jan-12 19:53
rajeevcapgeminiindia10-Jan-12 19:53 
GeneralRe: C#_Error "Namespace cannot directly contain..." Pin
Deborah Palmer McCain11-Jan-12 5:44
Deborah Palmer McCain11-Jan-12 5:44 
GeneralRe: C#_Error "Namespace cannot directly contain..." Pin
Deborah Palmer McCain11-Jan-12 6:39
Deborah Palmer McCain11-Jan-12 6:39 
AnswerRe: C#_Error "Namespace cannot directly contain..." Pin
RobCroll10-Jan-12 19:53
RobCroll10-Jan-12 19:53 
GeneralRe: C#_Error "Namespace cannot directly contain..." Pin
Deborah Palmer McCain11-Jan-12 5:50
Deborah Palmer McCain11-Jan-12 5:50 
GeneralRe: C#_Error "Namespace cannot directly contain..." Pin
Roger Wright11-Jan-12 18:18
professionalRoger Wright11-Jan-12 18:18 
GeneralRe: C#_Error "Namespace cannot directly contain..." Pin
Deborah Palmer McCain12-Jan-12 5:57
Deborah Palmer McCain12-Jan-12 5:57 
AnswerRe: C#_Error "Namespace cannot directly contain..." Pin
OriginalGriff10-Jan-12 22:19
mveOriginalGriff10-Jan-12 22:19 
The problem (as mentioned above) is your curly braces - the last two are commented out, as is should by them being coloured green.
If you get this kind of problem, Try CTRL+K CTRL+D - it formats your code so that everything is indented nicely. It won't work when you have missing braces, but if you fix that and try it, it should be obvious in future where things are going wrong.

BTW: You can change how Visual Studio handles your indentation to your preferred style in "Tools...Options" and then "TextEditor", "C#", "Formatting", "Indentation".

So if you prefer 1TBS:
C#
if (condition) {
   statement;
   statement;
}
Or K&R:
C#
if (condition)
{
   statement;
   statement;
}
Or Whitesmiths:
C#
if (condition)
   {
   statement;
   statement;
   }
You can get it to work with it happily. (I prefer Whitesmiths)
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

GeneralRe: C#_Error "Namespace cannot directly contain..." Pin
Deborah Palmer McCain11-Jan-12 5:55
Deborah Palmer McCain11-Jan-12 5:55 
GeneralRe: C#_Error "Namespace cannot directly contain..." Pin
killabyte11-Jan-12 16:49
killabyte11-Jan-12 16:49 
GeneralRe: C#_Error "Namespace cannot directly contain..." Pin
OriginalGriff11-Jan-12 21:40
mveOriginalGriff11-Jan-12 21:40 
GeneralRe: C#_Error "Namespace cannot directly contain..." Pin
BillWoodruff12-Jan-12 16:12
professionalBillWoodruff12-Jan-12 16:12 
GeneralRe: C#_Error "Namespace cannot directly contain..." Pin
OriginalGriff12-Jan-12 21:08
mveOriginalGriff12-Jan-12 21:08 
GeneralRe: C#_Error "Namespace cannot directly contain..." Pin
BobJanova12-Jan-12 23:33
BobJanova12-Jan-12 23:33 
QuestionGamebot / find images on grid / scrabulizer etc Pin
LordNeverwinter10-Jan-12 7:38
LordNeverwinter10-Jan-12 7:38 
AnswerRe: Gamebot / find images on grid / scrabulizer etc Pin
Alan Balkany10-Jan-12 8:21
Alan Balkany10-Jan-12 8:21 
GeneralRe: Gamebot / find images on grid / scrabulizer etc Pin
LordNeverwinter12-Jan-12 1:38
LordNeverwinter12-Jan-12 1:38 
GeneralRe: Gamebot / find images on grid / scrabulizer etc Pin
Alan Balkany13-Jan-12 4:09
Alan Balkany13-Jan-12 4:09 
GeneralRe: Gamebot / find images on grid / scrabulizer etc Pin
LordNeverwinter12-Jan-12 19:54
LordNeverwinter12-Jan-12 19:54 
AnswerRe: Gamebot / find images on grid / scrabulizer etc Pin
BillWoodruff12-Jan-12 16:18
professionalBillWoodruff12-Jan-12 16:18 
GeneralRe: Gamebot / find images on grid / scrabulizer etc Pin
LordNeverwinter12-Jan-12 19:41
LordNeverwinter12-Jan-12 19:41 
QuestionHow to check that a character can be encoded with codepage 1252? Pin
Bernhard Hiller10-Jan-12 3:48
Bernhard Hiller10-Jan-12 3:48 
AnswerRe: How to check that a character can be encoded with codepage 1252? Pin
Luc Pattyn10-Jan-12 4:24
sitebuilderLuc Pattyn10-Jan-12 4:24 
GeneralRe: How to check that a character can be encoded with codepage 1252? Pin
Bernhard Hiller10-Jan-12 21:13
Bernhard Hiller10-Jan-12 21:13 
AnswerRe: How to check that a character can be encoded with codepage 1252? Pin
jschell11-Jan-12 9:27
jschell11-Jan-12 9:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.