2

I have an array such as

 string[,] SSISVariableNameValue = new string[,] 
            {
            {"DestinationConfigDB","dest db"},
            {"DestinationServer","dest server"},
            {"SourceConfigDB","source db"},
            {"SourceServer","source server"},
            {"SSISConfigFilter","filter"}
            };

The .length property is listed as 10. How can i get the 'x' axis of this array..aside from dividing by 2?

Sam
  • 7,543
  • 7
  • 48
  • 62

1 Answers1

11

An array has a Rank property to tell you the number of dimensions and a GetLength(int d) function to give you the size in a specific dimension. d = 0 .. Rank-1

So you want SSISVariableNameValue.GetLength(0);

H H
  • 263,252
  • 30
  • 330
  • 514