tags:

views:

115

answers:

1

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?

+6  A: 

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);

Henk Holterman