-2

i am very new to C# programming so my question may sound very silly

actualy i am creating an multidimensional string array like

public class master
    {
       public List<string> user_selected = new List<string>();
       public List<string> available = new List<string>();
       public List<string> bookedseats = new List<string>();

       public  string [] [] trackbooked=new string[30][] ;

    }

now i am assigning some values to it like

a[l].trackbooked[i][j] = pb.Name;

a is a list of object List<master> a = new List<master>(); a.Add(obj0); a.Add(obj1); a.Add(obj2); a.Add(obj3); a.Add(obj4);

can some one plz help.thank u in adv.

too_cool
  • 1,114
  • 10
  • 21

2 Answers2

1

You've only initialized one dimension of your multidimensional array. See msdn for all the ways you can initialize a multidimensional array.

 public  string [,] trackbooked=new string[30,30] ;
Jason Nesbitt
  • 712
  • 1
  • 6
  • 15
-4

pb.Name.Tostring(); I would venture to guess that whatever pb is that its NAME value isn't returned as a string. You should be able to use the above command to correct your issue.

Ermac Pd
  • 3
  • 2