Wednesday, March 28, 2012

Simple Array

Good Morning I was wondering if anyone could give me a good example of a simple array in VB using ASP.net. I know how to do array's and such I just can't seem to get the lingo down for ASP.net though. I havn't been using asp.net for very long so im getting used to the terminology and how things work. So if someone could leave me a simple example to look at i would appreciate it greatly.
Thanks,
John Burkholder
Kandersteg, Inc.Not sure if this is what you are after. It shows declare an arrayof size 5, then doing a for loop to populate it, then shows a foreachloop to output the contents of the array.
Dim sa(5) As String
sa = New String(5) {}
Dim i As Int32
For i = 0 To sa.Length - 1
sa(i) = i.ToString()
Next
Dim s As String
For Each s In sa
Console.WriteLine(s)
Next
Exit Sub
bill

Try the links below for the two versions of Stringdictionary to get started with Arrays in Asp.net. The other option is to create a one dimension ArrayList and do ToArray. Hope this helps.


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemcollectionsspecializedstringdictionaryclasstopic.asp


http://msdn2.microsoft.com/en-us/library/system.collections.specialized.stringdictionary.aspx

0 comments:

Post a Comment