C# Error in my program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Newbie19
    New Member
    • Jun 2007
    • 122

    C# Error in my program

    I'm new to C# and I am learning it as I develop a program. I keep on getting this error, but I followed every book I've read so far.

    Here is the line that causes the error:

    new DefectService.D efectHandler(). AddDefect(new Guid("{guidnumb er}", Defect, null);

    There error is: Error 1 ) expected

    As you can see it underlines the ; at the end of my statement.

    Any advice or way to fix this issue will be a great help.

    thanks.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by Newbie19
    I'm new to C# and I am learning it as I develop a program. I keep on getting this error, but I followed every book I've read so far.

    Here is the line that causes the error:

    new DefectService.D efectHandler(). AddDefect(new Guid("{guidnumb er}", Defect, null);

    There error is: Error 1 ) expected

    As you can see it underlines the ; at the end of my statement.

    Any advice or way to fix this issue will be a great help.

    thanks.
    You're missing a closing bracket. (Count them). It should be

    [CODE=css] new DefectService.D efectHandler(). AddDefect(new Guid("{guidnumb er}", Defect, null));[/CODE]

    P.S This is the c++ forum not the c# forum

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      You have:
      Code:
      new DefectService.DefectHandler().AddDefect(new Guid("{guidnumber}", Defect, null);
      You are missing a close paren, the ")" for one of the calls.
      (Note: Don't add those newlines, I put them in there so you could see the issue)
      Code:
      new DefectService.DefectHandler().AddDefect
      (
         new Guid
         (
         "{guidnumber}", Defect, null
         )//<--you appear to be missing this closing paren
      );

      Comment

      • Newbie19
        New Member
        • Jun 2007
        • 122

        #4
        Thanks, that was the trick. Thanks.

        Comment

        Working...