| | |
vb dot net arrays
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2008
Posts: 14
Reputation:
Solved Threads: 0
i want to store multiple values in an array. lets say the variable name is voternumber which is a unique number that is generated which is between 1 and 5000. i will output the voternumber to a voter and then as them to input it so that i can perform a check to see wether it has been used before or not. To do this i will need to store all the unique voter numbers, i do not know how to do this i know of arrays but dont know how to add to them b clicking buttons.
Please help and elaborate by giving an example. thanks a lot. if not using arrays could you please explain any other method.
Please help and elaborate by giving an example. thanks a lot. if not using arrays could you please explain any other method.
Last edited by asif786; Jan 3rd, 2009 at 12:15 pm.
- List or ArrayList can be used for better reasons. and It contains
- Use Random class to generate numbers but check if the generated number is has been generated before or not.
.Contains method which to be used in your case.- Use Random class to generate numbers but check if the generated number is has been generated before or not.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
vb.net Syntax (Toggle Plain Text)
Dim numbers As List(Of Int32) while(numbers.Count > 100) { if Not numbers.Contains(GetRandomNumber()) numbers.Add(GetRandomNumber()) }
Last edited by Ramy Mahrous; Jan 3rd, 2009 at 3:26 pm. Reason: I wrote C# code instead of VB.NET!
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- How to configure GD (PHP)
- what kind of c++ for games (C++)
- vb6 to vb.net conversion problems (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: Using the table adapter in vb.net 2008
- Next Thread: What ListBox properties do I set to...
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account arithmetic array arrays basic bing button buttons c# center check checkbox code combobox convert crystalreport data database datagrid datagridview date dissertation dissertations dropdownlist excel fade file-dialog filter ftp generatetags google gridview hardcopy images inline input insert intel internet listview mobile monitor ms net networking objects output panel passingparameters picturebox picturebox1 port position print printing problem project read remove save searchbox searchvb.net select serial server shutdown soap sorting survey table tcp temperature text textbox timer timespan toolbox trim update user validation vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio2008 web winforms wpf year






