Click here to Skip to main content
16,016,580 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
There are two classess. Class A and Class B. Class A contains the Array of string. I have to pass that array from Class A to B.
Posted

visit must visit here...

Four ways of passing data between layers
 
Share this answer
 
Comments
Maciej Los 27-Nov-13 2:29am    
Good link!
+5!
[no name] 27-Nov-13 4:38am    
Thanks....
hi try this code..

C#
public class ClassA
    {
        public void MethodB()
        {
            CLassB obj = new CLassB();
            string[] array  = {"one","two","three"};
            obj.MethodA(array);
        }
    }
    public class CLassB
    {
        public void MethodA(string[] arrayparameter)
        {

        }
    }
 
Share this answer
 
I would suggest you to read this: Passing Arrays as Parameters (C# Programming Guide)[^].
Please, try!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900