Click here to Skip to main content
15,886,770 members
Home / Discussions / C#
   

C#

 
QuestionC# COM object and PowerBuilder Pin
TimWallace11-Jan-12 10:54
TimWallace11-Jan-12 10:54 
QuestionC#_Error "Namespace cannot directly contain..." Pin
Deborah Palmer McCain10-Jan-12 19:16
Deborah Palmer McCain10-Jan-12 19:16 
AnswerRe: C#_Error "Namespace cannot directly contain..." Pin
Roger Wright10-Jan-12 19:37
professionalRoger Wright10-Jan-12 19:37 
GeneralRe: C#_Error "Namespace cannot directly contain..." Pin
Deborah Palmer McCain11-Jan-12 5:43
Deborah Palmer McCain11-Jan-12 5:43 
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 
As mentioned, your } brackets are wrong and the problems starts with the ; at the end of your Main method.
C#
namespace _11012_debproject_2
{
 
    class Program
    {
        static void Main(string[] args) // don't want ; here
        {
              int number1;
              int number2;
              int multiply; //better using camel case not title case
 
              // prompt user
              // enter first number
              Console.WriteLine( "Enter first number:" ); //you needed ; here
              number1 (Console.Readline());
    
              // prompt user
              // enter second number
              Console.WriteLine( "Enter second number:") //And here as well
              number2 ( Console.ReadLine());
 
              product = number1 * number2;
 
              // multiply numbers
              Console.WriteLine( "product is {0}",product );
          
             //More stuff not provided in post

       } // End of Main method
    } //End of class
} //End of namesspace


You would do well to read a bit about naming conventions. namespaces should start with a letter. Not a number of underscore.

Enjoy
"You get that on the big jobs."

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 
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 

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.