Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi all visitors
Normally,array in vb.net has one dimensional(one column) and two dimensional(two column),if i want to create more then two columns, how can i do?

thanks
Posted
Comments
Sergey Alexandrovich Kryukov 12-Sep-11 23:02pm    
What, a regular MSDN help or language manual is out of reach?
--SA
Dr.Walt Fair, PE 12-Sep-11 23:40pm    
Normally an array has as many dimensions as you define. If you want more than 1 or 2, then just DIM more than 1 or 2 dimensions.

You can have more than two 'dimensions' to an array - see multi-dimensional arrays here[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 12-Sep-11 23:17pm    
Could you find a VB.NET link for OP? This is C# only. In most cases, language does not matter much, but in this case nearly all the problem is direct use of language syntax.
--SA
Abhinav S 12-Sep-11 23:24pm    
This should be fairly useful to the OP.
Arrays do not have "columns". :-)

You can have two kinds of rank-2 arrays in .NET — rectangular and jagged. The rectangular array has fixed dimension. It's more like a regular rank-1 array interpreted (indexed) as rank-2 array, using the knowledge of the dimensions. The jagged array is simply an array of arrays; so each "inner" array can have its individual length.

See this article to get how it looks and works in VB.NET code: http://visualbasic.about.com/od/quicktips/qt/initjaga.htm[^].

—SA
 
Share this answer
 
Comments
Abhinav S 12-Sep-11 23:16pm    
My 5.
Sergey Alexandrovich Kryukov 12-Sep-11 23:18pm    
Thank you, Abhinav.
--SA

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