Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

C# basics

Posted on 2006-11-20
1
Medium Priority
?
221 Views
Last Modified: 2010-04-16
using System;
using System.Collections;
namespace XMLTesting
{
      class Class1
      {
            
            private ArrayList alCardUpdateAcks=new ArrayList();
            static void Main(string[] args)
            {
                  public void AckMsg(ArrayList pCardUpdAcks)
                  {
                        alCardUpdateAcks = pCardUpdAcks;
                  }

            }
      }       
}

How can i make the above code compile free?. Because it is showing error in braces {,
even though it is proper.
0
Comment
Question by:Rahamathulla_J
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
daniel_balla earned 1000 total points
ID: 17985526
Hi Rahamathulla_J,
> using System;
> using System.Collections;
> namespace XMLTesting
> {
>      class Class1
>      {

>           private ArrayList alCardUpdateAcks=new ArrayList();
>           static void Main(string[] args)
>           {
>                public void AckMsg(ArrayList pCardUpdAcks)
>                {
>                     alCardUpdateAcks = pCardUpdAcks;
>                }

>           }
>      }      
> }
Hi
I am afraid it is not proper. you cannot have a function within a function so you would need to change it to:

using System;
using System.Collections;
namespace XMLTesting
{
     class Class1
     {
         
          private ArrayList alCardUpdateAcks=new ArrayList();
          static void Main(string[] args)
          {
              // Eventually callthe method here
              AckMsg(alCardUpdateAcks);
          }

         public void AckMsg(ArrayList pCardUpdAcks)
         {
             alCardUpdateAcks = pCardUpdAcks;
         }
     }      
}

Cheers!
Dani
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question