Creating teams

VB_Starter49

New member
Joined
Aug 27, 2007
Messages
2
Programming Experience
Beginner
Hi all!
I'm VERY new to VB. self learning as well. I have used VBA in the past for creating tools in ArcGIS. right now i'm a little bit like a fish out of water, but i am learning and finding it interesting.
My question:
I have been trying to create a program in VB express 2005 that will allow for a user to input a list of names into a table, click a button and get teams of 4. (i'm sure i have other questions like what happens when it gets down to the last 3 people) but for now i can't do much with the data. i have created a Dataset, bindingsource, and the dataview on the form for the user. I have created a button on my form and right now, i don't know what to do, i can't even view a name. i would love to at least be able to enter a name in the form click the button and have the name displayed in a message box. right now i can't even do that! If anyone has any advice or code to get me started that would be awsome! (cuz clearly i don't know what i'm doing! :D)
also if anyone has an idea for how i can sort and display names into groups of 4, that would be greatly appreciated! THANKS, sorry that this turned into a novel!
 
You need a button, datagridview, and a textbox on the form.

from there do the following:

' in the declarations section of the code file -- right under where it says Public Class Form1
Dim DT as new DataTable

' in the button click event
if not dt.columns.count > 0 then
dt.cloumns.add()
end if

if Textbox1.text.length > 0 then
DT.Rows.add(textbox1.text)
end if

DataGridView1.DataSource = DT

msgbox(Text1.text)


That should get you pointed in the right direction at least. Once you understand what's going on here then you should be ready to tackle sorting and grouping.
 
I wouldnt follow AdrenalineJunkie's advice initially; creating your own datatables on .NET 2.0 isnt necessary for a newbie. Have a read of the DW2 link in my signature, section on Creating a Simple Data App

Also read DNU for a common trap newbies fall into
 
Selecting a Single Record

Ok so I have a Datagridview on my form. And a user can open up my little program, and type in the names. which is great! all the names are displayed. I'm thinking i should have another field in the table (this is a datasource right in the form by the way, not taken from Access or SQL) anyways i'm trying to decide how to organize the names into groups of 4. (Randomly is the key, must be random) but i'm not really sure how to do this. I think i need to have another field which will allow for a number to be placed into the records so that each name is given a number randomly and that number must occur 4 times. My first problem is that I don't know how to move through each record. what do i use. I have made an attempt to use different DataSourceReader properties and just display a single record in a message box, however it always bugs out with some really generic errors. clearly i have the syntax wrong. Any helpful ideas would be appreciated, (thanks in advance for the time!)
 
Back
Top