Hullo Wonderful Friends
I need your help, Please help me.
I am using C#NET2008 to create Window Application using ARRAY. and ARRAY LENGTH
I do encounter a very surprising error with ARRAY LENGTH and is very confused about it.
I have declared an 2 Dimensional string Array Variable of [5,2]
To determine the length of the array I use this coding : int intArrayLenth = (strArrayCus.Le ngth)
and it produce the length of 10 instead of 5 as per declaration of [5,2]
Here are the coding :
I need your help, Please help me.
I am using C#NET2008 to create Window Application using ARRAY. and ARRAY LENGTH
I do encounter a very surprising error with ARRAY LENGTH and is very confused about it.
I have declared an 2 Dimensional string Array Variable of [5,2]
To determine the length of the array I use this coding : int intArrayLenth = (strArrayCus.Le ngth)
and it produce the length of 10 instead of 5 as per declaration of [5,2]
Here are the coding :
Code:
string[ , ] strArrayCus = new string [5, 2];
private void FillCustArray()
{
// --- fill Customer Array for Listview column header text and width
strArrayCus[0, 0] = "Cust ID";
strArrayCus[0, 1] = Convert.ToString(20);
strArrayCus[1, 0] = "CompanyName";
strArrayCus[1, 1] = Convert.ToString(100);
strArrayCus[2, 0] = "ContactName";
strArrayCus[2, 1] = Convert.ToString(80);
strArrayCus[3, 0] = "Phone ";
strArrayCus[3, 1] = Convert.ToString(30);
strArrayCus[4, 0] = "Fax";
strArrayCus[4, 1] = Convert.ToString(30);
}
int intArrayLenth = (strArrayCus.Length)[B]<= 10error[/B]
Comment